Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2224 from mklanjsek/theme-fix
Browse files Browse the repository at this point in the history
Fixed issue with theme initial value
  • Loading branch information
Sam Foo authored Mar 25, 2021
2 parents 5f9ab36 + f0b01f9 commit 044ec34
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,18 @@ describe('PreferencesService', () => {
100
);
});

it('theme initial value set properly', () => {
service.preferences.get('theme').subject.next('light');
const defaultPrefs = service.getPreferences();
const defaultElement = defaultPrefs.panels[0].sections[0].elements[0];
expect(defaultElement.name).toEqual('theme');
expect(defaultElement.value.toString()).toEqual('light');

service.preferences.get('theme').subject.next('dark');
const newPrefs = service.getPreferences();
const newElement = newPrefs.panels[0].sections[0].elements[0];
expect(newElement.name).toEqual('theme');
expect(newElement.value.toString()).toEqual('dark');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export class PreferencesService implements OnDestroy {
''
)
);
this.updateTheme();
}

ngOnDestroy(): void {
Expand Down

0 comments on commit 044ec34

Please sign in to comment.