From 2d2582d5a4b5ac2dd6f3ed53013947d74e860ebc Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Sat, 23 Sep 2023 12:02:18 -0500 Subject: [PATCH] Fix inspectng optin refs --- flows/inspect/dependencies.go | 2 ++ flows/inspect/dependencies_test.go | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/flows/inspect/dependencies.go b/flows/inspect/dependencies.go index 54c2cdb54..060a189a5 100644 --- a/flows/inspect/dependencies.go +++ b/flows/inspect/dependencies.go @@ -83,6 +83,8 @@ func CheckReference(sa flows.SessionAssets, ref assets.Reference) bool { return sa.Groups().Get(typed.UUID) != nil case *assets.LabelReference: return sa.Labels().Get(typed.UUID) != nil + case *assets.OptInReference: + return sa.OptIns().Get(typed.UUID) != nil case *assets.TemplateReference: return sa.Templates().Get(typed.UUID) != nil case *assets.TicketerReference: diff --git a/flows/inspect/dependencies_test.go b/flows/inspect/dependencies_test.go index 97632cd10..6c0f9208b 100644 --- a/flows/inspect/dependencies_test.go +++ b/flows/inspect/dependencies_test.go @@ -45,6 +45,7 @@ func TestDependencies(t *testing.T) { flows.NewExtractedReference(node1, action1, nil, i18n.NilLanguage, assets.NewGroupReference("46057a92-6580-4e93-af36-2bb9c9d61e51", "Testers")), flows.NewExtractedReference(node1, action1, nil, i18n.NilLanguage, assets.NewGroupReference("377c3101-a7fc-47b1-9136-980348e362c0", "Customers")), flows.NewExtractedReference(node1, action1, nil, i18n.NilLanguage, assets.NewLabelReference("31c06b7c-010d-4f91-9590-d3fbdc2fb7ac", "Spam")), + flows.NewExtractedReference(node1, action1, nil, i18n.NilLanguage, assets.NewOptInReference("c14b2e3f-997a-4547-a04e-6e9d5065c677", "Jokes")), flows.NewExtractedReference(node1, action1, nil, i18n.NilLanguage, assets.NewTemplateReference("ff958d30-f50e-48ab-a524-37ed1e9620d9", "Welcome")), flows.NewExtractedReference(node1, action1, nil, i18n.NilLanguage, assets.NewTicketerReference("fb9cab80-4450-4a9d-ba9b-cb8df40dd233", "Support")), flows.NewExtractedReference(node1, action1, nil, i18n.NilLanguage, assets.NewTopicReference("531d3fc7-64f4-4170-927d-b477e8145dd3", "Weather")), @@ -121,6 +122,12 @@ func TestDependencies(t *testing.T) { "type": "label", "uuid": "31c06b7c-010d-4f91-9590-d3fbdc2fb7ac" }, + { + "missing": true, + "name": "Jokes", + "type": "optin", + "uuid": "c14b2e3f-997a-4547-a04e-6e9d5065c677" + }, { "missing": true, "name": "Welcome",