Skip to content

Commit 8ab8311

Browse files
Add test: DialogueOptions can request to open action script in Roblox script editor (#178)
1 parent 3cbbf02 commit 8ab8311

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/DialogueEditor/components/Explorer/components/Preview/components/DialogueOptions/DialogueOptions.test.luau

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,35 @@ return {
272272
end).toFinishBeforeSeconds(1);
273273

274274
end);
275+
276+
it("can request to open condition script in Roblox script editor", function()
277+
278+
expect(function()
279+
280+
render("Message");
281+
282+
assert(screenGui, "ScreenGui should be initialized before running tests.");
283+
local dialogueOptions = screenGui:FindFirstChildOfClass("Frame");
284+
assert(dialogueOptions, "DialogueOptions should be rendered.");
285+
286+
local actionsDropdown = dialogueOptions:FindFirstChild("ActionsDropdown");
287+
assert(actionsDropdown, "Actions dropdown should be present in the DialogueOptions.");
288+
289+
local toggleButton = actionsDropdown:FindFirstChild("ToggleButton");
290+
assert(toggleButton and toggleButton:IsA("TextButton"), "Toggle button should be present in the ActionsDropdown.");
291+
292+
VirtualService.events.GuiButton.Activated:fireEvent(toggleButton);
293+
294+
local optionsFrame = actionsDropdown:WaitForChild("OptionsFrame");
295+
local initializationButton = optionsFrame:FindFirstChild("InitializationButton");
296+
assert(initializationButton and initializationButton:IsA("TextButton"), "Initialization button should be present in the ActionsDropdown options.");
297+
298+
VirtualService.events.GuiButton.Activated:fireEvent(initializationButton);
299+
repeat task.wait() until didOpenScript or propagatedErrorMessage;
300+
301+
end).toFinishBeforeSeconds(1);
302+
303+
end);
275304

276305
}
277306

0 commit comments

Comments
 (0)