@@ -85,9 +85,7 @@ TestCase {
8585
8686 tryVerify (() => it .settings .themeIdentifier () !== initialTheme);
8787
88- dialog .reject ();
89- dialog .close ();
90- it .bridge .waitForBackgroundJobs ();
88+ it .dialog .reject (dialog);
9189
9290 tryVerify (() => it .settings .themeIdentifier () === initialTheme);
9391 tryVerify (() => it .settings .primaryColor () === initialColor);
@@ -239,6 +237,29 @@ TestCase {
239237 tryVerify (() => it .settings .backupInterval () === newInterval);
240238 }
241239
240+ function test_backupDialog_reject_discardsSettings (): void {
241+ const control = it .makeControl ();
242+
243+ const initialEnabled = it .settings .backupEnabled ();
244+ const initialInterval = it .settings .backupInterval ();
245+
246+ it .menu .trigger (control, " optionsMenu" , " openBackupSettingsDialogMenuItem" );
247+ const dialog = it .find .openedDialog (control, " backupDialog" );
248+
249+ const switchRow = findChild (dialog, " backupEnabledRow" );
250+ verify (switchRow, " backupEnabledRow not found" );
251+ switchRow .checked = ! initialEnabled;
252+
253+ const intervalRow = findChild (dialog, " backupIntervalRow" );
254+ verify (intervalRow, " backupIntervalRow not found" );
255+ intervalRow .value = initialInterval + 30 ;
256+
257+ it .dialog .reject (dialog);
258+
259+ verify (it .settings .backupEnabled () === initialEnabled, " backup enabled should be unchanged after reject" );
260+ verify (it .settings .backupInterval () === initialInterval, " backup interval should be unchanged after reject" );
261+ }
262+
242263 function test_exportSettingsDialog_drivesAllSettings (): void {
243264 const control = it .makeControl ();
244265
@@ -276,6 +297,29 @@ TestCase {
276297 tryVerify (() => it .settings .writeHeaderSubtitles () === ! initial .subtitles );
277298 }
278299
300+ function test_exportSettingsDialog_reject_discardsSettings (): void {
301+ const control = it .makeControl ();
302+
303+ const initialNickname = it .settings .nickname ();
304+ const initialDate = it .settings .writeHeaderDate ();
305+
306+ it .menu .trigger (control, " optionsMenu" , " openExportSettingsDialogMenuItem" );
307+ const dialog = it .find .openedDialog (control, " exportSettingsDialog" );
308+
309+ const nicknameRow = findChild (dialog, " exportNicknameRow" );
310+ verify (nicknameRow, " exportNicknameRow not found" );
311+ nicknameRow .input = initialNickname + " -edited" ;
312+
313+ const dateRow = findChild (dialog, " exportWriteDateRow" );
314+ verify (dateRow, " exportWriteDateRow not found" );
315+ dateRow .checked = ! initialDate;
316+
317+ it .dialog .reject (dialog);
318+
319+ verify (it .settings .nickname () === initialNickname, " nickname should be unchanged after reject" );
320+ verify (it .settings .writeHeaderDate () === initialDate, " write header date should be unchanged after reject" );
321+ }
322+
279323 function test_importSettingsDialog_changeOption_persistsOnAccept (): void {
280324 const control = it .makeControl ();
281325 const initial = it .settings .importFoundVideo ();
@@ -294,6 +338,24 @@ TestCase {
294338 verify (it .settings .importFoundVideo () !== initial, " setting should differ from initial value" );
295339 }
296340
341+ function test_importSettingsDialog_reject_discardsSettings (): void {
342+ const control = it .makeControl ();
343+ const initial = it .settings .importFoundVideo ();
344+
345+ it .menu .trigger (control, " optionsMenu" , " openImportSettingsDialogMenuItem" );
346+ const dialog = it .find .openedDialog (control, " importSettingsDialog" );
347+
348+ const comboBox = findChild (dialog, " importFoundVideoComboBox" );
349+ verify (comboBox, " importFoundVideoComboBox not found" );
350+ const newIndex = comboBox .currentIndex === 0 ? comboBox .count - 1 : 0 ;
351+ verify (newIndex !== comboBox .currentIndex , " expected to pick a different option" );
352+ comboBox .activated (newIndex);
353+
354+ it .dialog .reject (dialog);
355+
356+ verify (it .settings .importFoundVideo () === initial, " import found video should be unchanged after reject" );
357+ }
358+
297359 function test_editMpvDialog_resetEditAcceptAndLinkActivation (): void {
298360 const control = it .makeControl ();
299361 const sentinel = " # integration-test-mpv-marker" ;
0 commit comments