1 | import testRangedFeatureHelpers from './helpers/testRangedFeatureHelpers';
|
2 | import cssSerialiser from './helpers/cssSerialiser';
|
3 | import { RANGED_FEATURES } from '../features';
|
4 |
|
5 | import {
|
6 | queryThrowsIfMissingBreakpoint,
|
7 | queryReturnsCorrectValueSingleBreakpoint,
|
8 | queryReturnsCorrectValueWithTwoBreakpoints,
|
9 | queryThrowsIfMissingEitherBreakpoint,
|
10 | queryThrowsWithBothBreakpointsTheSame,
|
11 | } from './sharedTests/rangedFeatureHelpers';
|
12 |
|
13 | expect.addSnapshotSerializer(cssSerialiser);
|
14 |
|
15 | const singleArgumentSharedTest = [
|
16 | queryThrowsIfMissingBreakpoint,
|
17 | queryReturnsCorrectValueSingleBreakpoint,
|
18 | ];
|
19 |
|
20 | describe('ranged feature helpers', () => {
|
21 | for (const feature of RANGED_FEATURES) {
|
22 | testRangedFeatureHelpers(feature.name, {
|
23 | tests: {
|
24 | above: [...singleArgumentSharedTest],
|
25 | below: [...singleArgumentSharedTest],
|
26 | between: [
|
27 | queryReturnsCorrectValueWithTwoBreakpoints,
|
28 | queryThrowsIfMissingEitherBreakpoint,
|
29 | queryThrowsWithBothBreakpointsTheSame,
|
30 | ],
|
31 | at: [...singleArgumentSharedTest],
|
32 | atBreakpoint: [...singleArgumentSharedTest],
|
33 | },
|
34 | });
|
35 | }
|
36 | });
|