Skip to content

Commit ba4cfc3

Browse files
committed
Update tests
1 parent 2069a56 commit ba4cfc3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/tests/services/ResizeService.spec.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,20 @@ describe('The `useResize` service', () => {
2929
expect(fn).not.toHaveBeenCalled();
3030
});
3131

32-
it('should return the current active breakpoint', () => {
33-
const service = useResize({ s: '0px', m: '1024px', l: '2048px' });
32+
it('should return the current active breakpoint', async () => {
33+
const service = useResize({ s: '0px', m: '1025px', l: '2048px' });
3434
expect(service.props().breakpoints).toEqual(['s', 'm', 'l']);
3535

36-
useMatchMedia('(min-width: 1024px)');
36+
await resizeWindow({ width: 1025 });
37+
useMatchMedia('(min-width: 1025px)');
3738
expect(service.props().activeBreakpoints).toEqual({
3839
s: false,
3940
m: true,
4041
l: false,
4142
});
4243
expect(service.props().breakpoint).toBe('m');
4344

45+
await resizeWindow({ width: 2048 });
4446
useMatchMedia('(min-width: 2048px)');
4547
expect(service.props().activeBreakpoints).toEqual({
4648
s: false,

0 commit comments

Comments
 (0)