This repository has been archived by the owner on Aug 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathindex.test.jsx
91 lines (82 loc) · 2.58 KB
/
index.test.jsx
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import { testUtilityPackages } from '@bbc/psammead-test-helpers';
import * as spacings from './spacings';
import * as breakpoints from './breakpoints';
import * as typography from './typography';
import * as spacingsFromSrc from './src/spacings';
import * as breakpointsFromSrc from './src/breakpoints';
import * as typographyFromSrc from './src/typography';
/*
If you are doing anything than extending these export lists it's likely to introduce a breaking change
*/
const spacingsExpectedExports = {
GEL_SPACING: 'string',
GEL_SPACING_DBL: 'string',
GEL_SPACING_TRPL: 'string',
GEL_SPACING_HLF: 'string',
GEL_SPACING_QUAD: 'string',
GEL_MARGIN_BELOW_400PX: 'string',
GEL_GUTTER_BELOW_600PX: 'string',
GEL_MARGIN_ABOVE_400PX: 'string',
GEL_GUTTER_ABOVE_600PX: 'string',
};
const breakpointsExpectedExports = {
GEL_GROUP_B_MIN_WIDTH: 'number',
GEL_GROUP_B_MAX_WIDTH: 'number',
GEL_GROUP_CD_MIN_WIDTH: 'number',
GEL_GROUP_0_SCREEN_WIDTH_MIN: 'string',
GEL_GROUP_0_SCREEN_WIDTH_MAX: 'string',
GEL_GROUP_1_SCREEN_WIDTH_MIN: 'string',
GEL_GROUP_1_SCREEN_WIDTH_MAX: 'string',
GEL_GROUP_2_SCREEN_WIDTH_MIN: 'string',
GEL_GROUP_2_SCREEN_WIDTH_MAX: 'string',
GEL_GROUP_3_SCREEN_WIDTH_MIN: 'string',
GEL_GROUP_3_SCREEN_WIDTH_MAX: 'string',
GEL_GROUP_4_SCREEN_WIDTH_MIN: 'string',
GEL_GROUP_4_SCREEN_WIDTH_MAX: 'string',
GEL_GROUP_5_SCREEN_WIDTH_MIN: 'string',
MEDIA_QUERY_TYPOGRAPHY: 'object',
};
const typographyExpectedExports = {
GEL_ATLAS: 'string',
GEL_ELEPHANT: 'string',
GEL_IMPERIAL: 'string',
GEL_ROYAL: 'string',
GEL_FOOLSCAP: 'string',
GEL_CANON: 'string',
GEL_TRAFALGAR: 'string',
GEL_PARAGON: 'string',
GEL_DOUBLE_PICA: 'string',
GEL_GREAT_PRIMER: 'string',
GEL_BODY_COPY: 'string',
GEL_PICA: 'string',
GEL_LONG_PRIMER: 'string',
GEL_BREVIER: 'string',
GEL_MINION: 'string',
};
const expectedExports = {
spacings: spacingsExpectedExports,
breakpoints: breakpointsExpectedExports,
typography: typographyExpectedExports,
};
const actualExports = {
spacings,
breakpoints,
typography,
};
const actualExportsFromSrc = {
spacings: spacingsFromSrc,
breakpoints: breakpointsFromSrc,
typography: typographyFromSrc,
};
describe('Gel constants', () => {
it('should test all the utility exports exist and are the correct type', () => {
testUtilityPackages(actualExports, expectedExports, 'gel-foundations');
});
it('should test all the utility exports exist and are the correct type when coming from src/', () => {
testUtilityPackages(
actualExportsFromSrc,
expectedExports,
'gel-foundations/src',
);
});
});