Skip to content

Commit

Permalink
test: replaced called with callCount.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhyd1997 committed May 13, 2023
1 parent 00fa708 commit a358d5d
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ describe('ThemeButton', () => {
expect(wrapper.exists()).toBe(true);
});

it('Should switch theme', () => {
it('Should switch theme', async () => {
const themeRepository = stubLocalWindowThemeRepository();
const wrapper = wrap({ themeRepository });

const checkbox = wrapper.find('.container_toggle');
expect(themeRepository.get.calledOnce).toBe(true);
expect(themeRepository.choose.calledOnce).toBe(true);
expect(themeRepository.choose.callCount).toBe(1);

checkbox.trigger('change');
expect(themeRepository.choose.called).toBe(true);
await checkbox.trigger('change');
expect(themeRepository.choose.callCount).toBe(2);

checkbox.trigger('change');
expect(themeRepository.choose.called).toBe(true);
expect(themeRepository.choose.callCount).toBe(3);
});
});

0 comments on commit a358d5d

Please sign in to comment.