From 3b4fdf198a58b3ee682ee716af32fc72f07bc85e Mon Sep 17 00:00:00 2001 From: Christian Toney Date: Fri, 27 Jun 2025 15:01:42 -0400 Subject: [PATCH] Add test: AutoTriggerCheckbox can automatically refresh if ShouldAutoTriggerConversation attribute is toggled --- .../AutoTriggerCheckbox.test.luau | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/DialogueEditor/components/Explorer/components/Preview/components/AutoTriggerCheckbox/AutoTriggerCheckbox.test.luau b/src/DialogueEditor/components/Explorer/components/Preview/components/AutoTriggerCheckbox/AutoTriggerCheckbox.test.luau index e8083e3..746579b 100644 --- a/src/DialogueEditor/components/Explorer/components/Preview/components/AutoTriggerCheckbox/AutoTriggerCheckbox.test.luau +++ b/src/DialogueEditor/components/Explorer/components/Preview/components/AutoTriggerCheckbox/AutoTriggerCheckbox.test.luau @@ -62,7 +62,7 @@ return { end; - local function render(initialValue: boolean): ModuleScript + local function render(initialValue: boolean?): ModuleScript assert(reactRoot, "React root should be initialized before running tests."); @@ -138,6 +138,24 @@ return { end).toFinishBeforeSeconds(1); end); + + it(`automatically refreshes if ShouldAutoTriggerConversation attribute is toggled`, function() + + expect(function() + + local selectedScript = render(); + verifyReactStatus(); + + local checkbox = getCheckbox(); + selectedScript:SetAttribute("ShouldAutoTriggerConversation", true); + checkbox:GetPropertyChangedSignal("BackgroundColor3"):Wait(); + + selectedScript:SetAttribute("ShouldAutoTriggerConversation", false); + checkbox:GetPropertyChangedSignal("BackgroundColor3"):Wait(); + + end).toFinishBeforeSeconds(1); + + end); }