@hero-design/rn-work-uikit 1.9.4 → 1.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/es/index.js +69810 -0
- package/lib/index.js +809 -440
- package/package.json +5 -5
- package/src/components/RichTextEditor/MentionList.tsx +2 -1
- package/testUtils/renderWithTheme.tsx +2 -2
- package/types/index.d.ts +525 -0
- package/src/__tests__/index-export.spec.ts +0 -64
- package/src/__tests__/index.spec.tsx +0 -14
- package/src/components/DatePicker/__tests__/__snapshots__/index.spec.tsx.snap +0 -1649
- package/src/components/DatePicker/__tests__/index.spec.tsx +0 -56
- package/src/components/FormGroup/__tests__/__snapshots__/index.spec.tsx.snap +0 -908
- package/src/components/FormGroup/__tests__/index.spec.tsx +0 -319
- package/src/components/FormGroup/__tests__/utils.spec.ts +0 -73
- package/src/components/RichTextEditor/__tests__/EditorToolbar.spec.tsx +0 -154
- package/src/components/RichTextEditor/__tests__/MentionList.spec.tsx +0 -105
- package/src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx +0 -81
- package/src/components/RichTextEditor/__tests__/RichTextEditorInput.spec.tsx +0 -174
- package/src/components/RichTextEditor/__tests__/__snapshots__/EditorToolbar.spec.tsx.snap +0 -407
- package/src/components/RichTextEditor/__tests__/__snapshots__/MentionList.spec.tsx.snap +0 -13
- package/src/components/Select/__tests__/__snapshots__/index.spec.tsx.snap +0 -1324
- package/src/components/Select/__tests__/index.spec.tsx +0 -43
- package/src/components/TextInput/__tests__/ErrorOrHelpText.spec.tsx +0 -20
- package/src/components/TextInput/__tests__/FloatingLabel.spec.tsx +0 -193
- package/src/components/TextInput/__tests__/InputComponent.spec.tsx +0 -41
- package/src/components/TextInput/__tests__/InputRow.spec.tsx +0 -233
- package/src/components/TextInput/__tests__/MaxLengthMessage.spec.tsx +0 -17
- package/src/components/TextInput/__tests__/PrefixComponent.spec.tsx +0 -14
- package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +0 -114
- package/src/components/TextInput/__tests__/SuffixComponent.spec.tsx +0 -20
- package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +0 -583
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +0 -5835
- package/src/components/TextInput/__tests__/getState.spec.tsx +0 -89
- package/src/components/TextInput/__tests__/index.spec.tsx +0 -679
- package/src/components/TimePicker/__tests__/index.spec.tsx +0 -34
- package/src/theme/__tests__/ThemeProvider.spec.tsx +0 -32
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +0 -2042
- package/src/theme/__tests__/index.spec.ts +0 -7
- package/src/utils/__tests__/helpers.spec.ts +0 -92
- package/stats/1.3.0/rn-work-uikit-stats.html +0 -4842
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { deepCompareValue, omit, pick } from '../helpers';
|
|
2
|
-
|
|
3
|
-
describe('pick', () => {
|
|
4
|
-
it('works', () => {
|
|
5
|
-
const props = { a: 1, b: true, c: 'outline', d: null, f: 'whatever' };
|
|
6
|
-
|
|
7
|
-
expect(pick(['a', 'b', 'f'], props)).toEqual({
|
|
8
|
-
a: 1,
|
|
9
|
-
b: true,
|
|
10
|
-
f: 'whatever',
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('work with unknown object type', () => {
|
|
15
|
-
const props: Record<string, unknown> = {
|
|
16
|
-
a: 1,
|
|
17
|
-
b: true,
|
|
18
|
-
c: 'outline',
|
|
19
|
-
d: null,
|
|
20
|
-
f: 'whatever',
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
expect(pick(['a', 'b', 'f'], props)).toEqual({
|
|
24
|
-
a: 1,
|
|
25
|
-
b: true,
|
|
26
|
-
f: 'whatever',
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
describe('omit', () => {
|
|
32
|
-
it('works', () => {
|
|
33
|
-
const props = { a: 1, b: true, c: 'outline', d: null, f: 'whatever' };
|
|
34
|
-
|
|
35
|
-
expect(omit(['a', 'b'], props)).toEqual({
|
|
36
|
-
c: 'outline',
|
|
37
|
-
d: null,
|
|
38
|
-
f: 'whatever',
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
it('work with unknown object type', () => {
|
|
43
|
-
const props: Record<string, unknown> = {
|
|
44
|
-
a: 1,
|
|
45
|
-
b: true,
|
|
46
|
-
c: 'outline',
|
|
47
|
-
d: null,
|
|
48
|
-
f: 'whatever',
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
expect(omit(['a', 'b'], props)).toEqual({
|
|
52
|
-
c: 'outline',
|
|
53
|
-
d: null,
|
|
54
|
-
f: 'whatever',
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
describe('deepCompareValue', () => {
|
|
60
|
-
it.each`
|
|
61
|
-
a | b | expected
|
|
62
|
-
${1} | ${1} | ${true}
|
|
63
|
-
${'test'} | ${'test'} | ${true}
|
|
64
|
-
${true} | ${true} | ${true}
|
|
65
|
-
${null} | ${null} | ${true}
|
|
66
|
-
${undefined} | ${undefined} | ${true}
|
|
67
|
-
${1} | ${2} | ${false}
|
|
68
|
-
${'test'} | ${'other'} | ${false}
|
|
69
|
-
${true} | ${false} | ${false}
|
|
70
|
-
${null} | ${undefined} | ${false}
|
|
71
|
-
${NaN} | ${NaN} | ${false}
|
|
72
|
-
${1} | ${NaN} | ${false}
|
|
73
|
-
${[1, 2, 3]} | ${[1, 2, 3]} | ${true}
|
|
74
|
-
${['a', 'b']} | ${['a', 'b']} | ${true}
|
|
75
|
-
${[]} | ${[]} | ${true}
|
|
76
|
-
${[1, 2]} | ${[1, 2, 3]} | ${false}
|
|
77
|
-
${[1, 2]} | ${[2, 1]} | ${false}
|
|
78
|
-
${[1, [2, 3]]} | ${[1, [2, 3]]} | ${true}
|
|
79
|
-
${[1, [2, 3]]} | ${[1, [2, 4]]} | ${false}
|
|
80
|
-
${{ a: 1, b: 2 }} | ${{ a: 1, b: 2 }} | ${true}
|
|
81
|
-
${{}} | ${{}} | ${true}
|
|
82
|
-
${{ a: 1 }} | ${{ a: 2 }} | ${false}
|
|
83
|
-
${{ a: 1 }} | ${{ b: 1 }} | ${false}
|
|
84
|
-
${{ a: 1 }} | ${{ a: 1, b: 2 }} | ${false}
|
|
85
|
-
${{ a: { b: 1 } }} | ${{ a: { b: 1 } }} | ${true}
|
|
86
|
-
${{ a: { b: 1 } }} | ${{ a: { b: 2 } }} | ${false}
|
|
87
|
-
${1} | ${'1'} | ${false}
|
|
88
|
-
${[]} | ${{}} | ${false}
|
|
89
|
-
`('should compare $a and $b correctly', ({ a, b, expected }) => {
|
|
90
|
-
expect(deepCompareValue(a, b)).toBe(expected);
|
|
91
|
-
});
|
|
92
|
-
});
|