Only run prompt-for-save test logic when relevant

This commit is contained in:
Bartłomiej Dach 2021-09-12 13:44:25 +02:00
parent 35ee889e5b
commit cbb9ff1c49
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497
1 changed files with 5 additions and 2 deletions

View File

@ -98,8 +98,11 @@ public void TestClipboardPreservedAfterSwitch([Values] bool sameRuleset)
AddStep("exit editor", () => Stack.Exit());
AddUntilStep("prompt for save dialog shown", () => DialogOverlay.CurrentDialog is PromptForSaveDialog);
AddStep("discard changes", () => ((PromptForSaveDialog)DialogOverlay.CurrentDialog).PerformOkAction());
if (sameRuleset)
{
AddUntilStep("prompt for save dialog shown", () => DialogOverlay.CurrentDialog is PromptForSaveDialog);
AddStep("discard changes", () => ((PromptForSaveDialog)DialogOverlay.CurrentDialog).PerformOkAction());
}
// ensure editor loader didn't resume.
AddAssert("stack empty", () => Stack.CurrentScreen == null);