Skip to content

Commit

Permalink
chore: fix test
Browse files Browse the repository at this point in the history
Change-Id: I4a4bc10332329bfa6a2aa3829fdb969615e7ff0a
Signed-off-by: Florent Benoit <[email protected]>
  • Loading branch information
benoitf committed Oct 25, 2024
1 parent 54d2a29 commit 3a623db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/Appearance.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function getRootElementClassesValue(container: HTMLElement): string | undefined
test('check initial light theme', async () => {
const { baseElement } = render(Appearance, {});
// expect to have no (dark) class as OS is using light
await vi.waitFor(() => expect(getRootElementClassesValue(baseElement)).toBe(''));
await vi.waitFor(() => expect(getRootElementClassesValue(baseElement)).toBe('light'));
});

test('check initial dark theme', async () => {
Expand Down Expand Up @@ -97,7 +97,7 @@ test('Expect event being changed when changing the default appearance on the ope
userCallback();

// check if it's now light
await vi.waitFor(() => expect(getRootElementClassesValue(baseElement)).toBe(''));
await vi.waitFor(() => expect(getRootElementClassesValue(baseElement)).toBe('light'));

// now change to dark
window.matchMedia = vi.fn().mockReturnValue({
Expand Down

0 comments on commit 3a623db

Please sign in to comment.