Skip to content

Commit

Permalink
fix: test-assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
oynikishin committed Mar 2, 2023
1 parent a04fe2f commit 4061b95
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/Toaster/__tests__/ToasterProvider.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ describe('api.removeAll', () => {
describe('api.has', () => {
it('should return false when toast is not added', () => {
const providerAPI = setup();
expect(providerAPI.has('unexisted toasts')).toBeFalsy();
expect(providerAPI.has('unexisted toasts')).toBe(false);
});

it('should return false when toast is removed by code', () => {
Expand All @@ -268,14 +268,14 @@ describe('api.has', () => {
});

const toast = getToast();
expect(providerAPI.has(toastProps.name)).toBeTruthy();
expect(providerAPI.has(toastProps.name)).toBe(true);

act(() => {
providerAPI.remove(toastProps.name);
});
tick(toast, 0);

expect(providerAPI.has(toastProps.name)).toBeFalsy();
expect(providerAPI.has(toastProps.name)).toBe(false);
});

it('should return false when toast is removed by timer', () => {
Expand All @@ -289,15 +289,15 @@ describe('api.has', () => {
});

const toast = getToast();
expect(providerAPI.has(toastProps.name)).toBeTruthy();
expect(providerAPI.has(toastProps.name)).toBe(true);

act(() => {
jest.advanceTimersByTime(toastTimeout);
});
expect(providerAPI.has(toastProps.name)).toBeTruthy();
expect(providerAPI.has(toastProps.name)).toBe(true);

fireAnimationEndEvent(toast, 'toast-hide-end');

expect(providerAPI.has(toastProps.name)).toBeFalsy();
expect(providerAPI.has(toastProps.name)).toBe(false);
});
});

0 comments on commit 4061b95

Please sign in to comment.