-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathuseBreakpoints.test.ts
More file actions
44 lines (40 loc) · 1.17 KB
/
useBreakpoints.test.ts
File metadata and controls
44 lines (40 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import {describe, expect, it} from 'vitest';
import useBreakpoints, {breakpointProps} from '.';
describe('useBreakpoints', () => {
describe('breakpointClasses', () => {
it('maps breakpoint properties to classes', () => {
const {breakpointClasses} = useBreakpoints(
{
sm: 0,
md: 1,
lg: 2,
xl: 3,
xxl: 4,
},
'break-{0}-{1}',
);
expect(breakpointClasses.value).toStrictEqual([
'break-sm-0',
'break-md-1',
'break-lg-2',
'break-xl-3',
'break-xxl-4',
]);
});
});
describe('breakpointProps', () => {
it('maps breakpoints to properies', () => {
const props = breakpointProps(
{},
'break-{0}',
);
expect(props).toStrictEqual({
'break-sm': {},
'break-md': {},
'break-lg': {},
'break-xl': {},
'break-xxl': {},
});
});
});
});