-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathutils.test.ts
40 lines (35 loc) · 1.02 KB
/
utils.test.ts
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
import {
generateNormalizedItems,
sampleSectionIdAndClasses,
sampleSectionIdAndClassesSpectrum,
} from './utils';
describe('generateNormalizedItems', () => {
it('should generate normalized items', () => {
const actual = [...generateNormalizedItems(100)];
expect(actual).toMatchSnapshot();
});
});
describe('sampleSectionIdAndClasses', () => {
it('should return id and className', () => {
const actual = sampleSectionIdAndClasses('some-id', [
'some-class-a',
'some-class-b',
]);
expect(actual).toEqual({
id: 'sample-section-some-id',
className: 'sample-section some-class-a some-class-b',
});
});
});
describe('sampleSectionIdAndClassesSpectrum', () => {
it('should return id and UNSAFE_className', () => {
const actual = sampleSectionIdAndClassesSpectrum('some-id', [
'some-class-a',
'some-class-b',
]);
expect(actual).toEqual({
id: 'sample-section-some-id',
UNSAFE_className: 'sample-section some-class-a some-class-b',
});
});
});