test: 💍 fixes flaky theme selection test (#1592)

✅ Closes: icu-7597
This commit is contained in:
Randall Morey authored and GitHub committed 2023-01-19 16:53:02 -08:00
1 parent ee85497182
commit 54d5d34981
4 files changed
+26 -8

No files matched your search

+8 -2
View File
@@ -32,12 +32,18 @@
<Rose::Form as |form|>
<form.radioGroup
@name='theme'
@selectedValue={{this.session.data.theme}}
@selectedValue={{or
this.session.data.theme
'system-default-theme'
}}
@changed={{route-action 'toggleTheme'}}
as |radioGroup|
>
<dropdown.item>
<radioGroup.radio @label={{t 'themes.system'}} />
<radioGroup.radio
@label={{t 'themes.system'}}
@value='system-default-theme'
/>
</dropdown.item>
<dropdown.item>
<radioGroup.radio
@@ -350,8 +350,11 @@ module('Acceptance | authentication', function (hooks) {
assert.notOk(getRootElement().classList.contains('rose-theme-light'));
assert.ok(getRootElement().classList.contains('rose-theme-dark'));
// toggle system default
await click('[name="theme"][value=""]');
assert.notOk(currentSession().get('data.theme'));
await click('[name="theme"][value="system-default-theme"]');
assert.strictEqual(
currentSession().get('data.theme'),
'system-default-theme'
);
assert.notOk(getRootElement().classList.contains('rose-theme-light'));
assert.notOk(getRootElement().classList.contains('rose-theme-dark'));
});
+8 -2
View File
@@ -55,12 +55,18 @@
<Rose::Form as |form|>
<form.radioGroup
@name='theme'
@selectedValue={{this.session.data.theme}}
@selectedValue={{or
this.session.data.theme
'system-default-theme'
}}
@changed={{route-action 'toggleTheme'}}
as |radioGroup|
>
<dropdown.item>
<radioGroup.radio @label={{t 'themes.system'}} />
<radioGroup.radio
@label={{t 'themes.system'}}
@value='system-default-theme'
/>
</dropdown.item>
<dropdown.item>
<radioGroup.radio
@@ -242,8 +242,11 @@ module('Acceptance | authentication', function (hooks) {
assert.notOk(getRootElement().classList.contains('rose-theme-light'));
assert.ok(getRootElement().classList.contains('rose-theme-dark'));
// toggle system default
await click('[name="theme"][value=""]');
assert.notOk(currentSession().get('data.theme'));
await click('[name="theme"][value="system-default-theme"]');
assert.strictEqual(
currentSession().get('data.theme'),
'system-default-theme'
);
assert.notOk(getRootElement().classList.contains('rose-theme-light'));
assert.notOk(getRootElement().classList.contains('rose-theme-dark'));
});