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); }