Skip to content

Commit

Permalink
add getTheme unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
jiji14 committed May 29, 2024
1 parent a963381 commit 3f08b6c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions www/__tests__/appTheme.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { getTheme } from '../js/appTheme';

describe('getTheme', () => {
it('should return the right theme with place', () => {
const theme = getTheme('place');
expect(theme.colors.elevation.level1).toEqual('#cbe6ff');
});

it('should return the right theme with untracked', () => {
const theme = getTheme('untracked');
expect(theme.colors.primary).toEqual('#8c4a57');
expect(theme.colors.primaryContainer).toEqual('#e3bdc2');
expect(theme.colors.elevation.level1).toEqual('#f8ebec');
});

it('should return the right theme with draft', () => {
const theme = getTheme('draft');
expect(theme.colors.primary).toEqual('#616971');
expect(theme.colors.primaryContainer).toEqual('#b6bcc2');
expect(theme.colors.background).toEqual('#eef1f4');
});
});

0 comments on commit 3f08b6c

Please sign in to comment.