@inseefr/lunatic 0.3.4-experimental → 0.3.7-experimental

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.
Files changed (85) hide show
  1. package/lib/index.js +2 -2
  2. package/lib/index.js.map +1 -1
  3. package/package.json +2 -1
  4. package/src/components/breadcrumb/component.js +29 -29
  5. package/src/components/button/component.js +53 -53
  6. package/src/components/button/index.js +1 -1
  7. package/src/components/checkbox/index.js +3 -3
  8. package/src/components/datepicker/index.js +1 -1
  9. package/src/components/declarations/index.js +1 -1
  10. package/src/components/declarations/wrappers/list-declarations-wrapper.js +232 -232
  11. package/src/components/filter-description/component.js +42 -42
  12. package/src/components/icon/component.js +33 -33
  13. package/src/components/index.js +2 -0
  14. package/src/components/input/index.js +2 -2
  15. package/src/components/loop/index.js +1 -1
  16. package/src/components/loop-constructor/wrapper/body-component.js +13 -1
  17. package/src/components/radio/index.js +1 -1
  18. package/src/components/sequence/index.js +1 -1
  19. package/src/components/subsequence/index.js +1 -1
  20. package/src/components/suggester/check-store.js +70 -70
  21. package/src/components/suggester/components/create-on-keydown-callback.js +28 -28
  22. package/src/components/tooltip/response.js +52 -52
  23. package/src/stories/checkbox-boolean/data-forced.json +48 -48
  24. package/src/stories/checkbox-group/data-vtl.json +102 -102
  25. package/src/stories/icons/icons.stories.js +16 -16
  26. package/src/stories/questionnaire/kish.json +275 -0
  27. package/src/stories/questionnaire/questionnaire.stories.js +12 -0
  28. package/src/stories/utils/custom-lunatic.scss +23 -23
  29. package/src/tests/components/breadcrumb.spec.js +13 -13
  30. package/src/tests/components/button.spec.js +11 -11
  31. package/src/tests/components/checkbox-boolean.spec.js +45 -45
  32. package/src/tests/components/checkbox-group.spec.js +53 -53
  33. package/src/tests/components/checkbox-one.spec.js +32 -32
  34. package/src/tests/components/datepicker.spec.js +22 -22
  35. package/src/tests/components/declarations-wrappers/input-declarations-wrapper.spec.js +67 -67
  36. package/src/tests/components/declarations-wrappers/list-declarations-wrapper.spec.js +52 -52
  37. package/src/tests/components/declarations-wrappers/simple-declarations-wrapper.spec.js +21 -21
  38. package/src/tests/components/declarations.spec.js +46 -46
  39. package/src/tests/components/input.spec.js +18 -18
  40. package/src/tests/components/loops/loop-static.json +66 -66
  41. package/src/tests/components/loops/loop.json +258 -258
  42. package/src/tests/components/loops/loop.spec.js +30 -30
  43. package/src/tests/components/loops/roster-for-loop.spec.js +18 -18
  44. package/src/tests/components/progress-bar.spec.js +15 -15
  45. package/src/tests/components/radio.spec.js +27 -27
  46. package/src/tests/components/sequence.spec.js +9 -9
  47. package/src/tests/components/subsequence.spec.js +9 -9
  48. package/src/tests/components/table.spec.js +11 -11
  49. package/src/tests/components/textarea.spec.js +18 -18
  50. package/src/tests/components/tooltip.spec.js +25 -25
  51. package/src/tests/setup/setupTests.js +4 -4
  52. package/src/tests/utils/lib/alphabet.spec.js +36 -36
  53. package/src/tests/utils/lib/array.spec.js +22 -22
  54. package/src/tests/utils/lib/checkbox/group.spec.js +72 -72
  55. package/src/tests/utils/lib/decorator/title-decorator.spec.js +12 -12
  56. package/src/tests/utils/lib/input-number.spec.js +18 -18
  57. package/src/tests/utils/lib/items-positioning.spec.js +17 -17
  58. package/src/tests/utils/lib/label-position.spec.js +22 -22
  59. package/src/tests/utils/lib/loops/bindings.spec.js +75 -75
  60. package/src/tests/utils/lib/loops/shared.spec.js +82 -82
  61. package/src/tests/utils/lib/missing/missing.spec.js +74 -74
  62. package/src/tests/utils/lib/missing/mock.js +137 -137
  63. package/src/tests/utils/lib/pagination/shared.spec.js +42 -42
  64. package/src/tests/utils/lib/responses.spec.js +64 -64
  65. package/src/tests/utils/lib/style.spec.js +26 -26
  66. package/src/tests/utils/lib/tooltip/build-response.spec.js +95 -95
  67. package/src/tests/utils/lib/tooltip/content.spec.js +109 -109
  68. package/src/tests/utils/to-expose/handler/handler.spec.js +94 -94
  69. package/src/tests/utils/to-expose/handler/questionnaire.json +158 -158
  70. package/src/tests/utils/to-expose/handler/results/index.js +6 -6
  71. package/src/tests/utils/to-expose/handler/results/res-double.json +158 -158
  72. package/src/tests/utils/to-expose/handler/results/res-input-collected.json +158 -158
  73. package/src/tests/utils/to-expose/handler/results/res-loop.json +158 -158
  74. package/src/tests/utils/to-expose/handler/results/res-matrix.json +158 -158
  75. package/src/tests/utils/to-expose/handler/results/res-responses.json +158 -158
  76. package/src/tests/utils/to-expose/hooks/use-lunatic.spec.js +46 -46
  77. package/src/tests/utils/to-expose/init-questionnaire/data.json +12 -12
  78. package/src/tests/utils/to-expose/init-questionnaire/init-questionnaire.spec.js +19 -19
  79. package/src/tests/utils/to-expose/interpret/interpret.spec.js +48 -48
  80. package/src/tests/utils/to-expose/state/questionnaire.json +61 -61
  81. package/src/tests/utils/to-expose/state/results.js +78 -78
  82. package/src/utils/lib/tooltip/build-response.js +41 -41
  83. package/src/utils/store-tools/create/index.js +1 -1
  84. package/src/utils/store-tools/create/update-store-info.js +26 -26
  85. package/src/utils/store-tools/index.js +5 -5
@@ -1,27 +1,27 @@
1
- import React from 'react';
2
- import { shallow, mount } from 'enzyme';
3
- import { Radio } from 'components';
4
-
5
- const handleChange = jest.fn();
6
- const options = [
7
- { value: 'france', label: 'France' },
8
- { value: 'italy', label: 'Italy' },
9
- ];
10
- const response = { values: { COLLECTED: 'italy' } };
11
- const defaultProps = {
12
- id: 'id',
13
- label: 'label',
14
- handleChange,
15
- options,
16
- response,
17
- };
18
-
19
- describe('radio', () => {
20
- it('renders without crashing', () => {
21
- mount(<Radio {...defaultProps} />);
22
- });
23
-
24
- it('returns management & disabled component', () => {
25
- shallow(<Radio {...defaultProps} management disabled />);
26
- });
27
- });
1
+ import React from 'react';
2
+ import { shallow, mount } from 'enzyme';
3
+ import { Radio } from 'components';
4
+
5
+ const handleChange = jest.fn();
6
+ const options = [
7
+ { value: 'france', label: 'France' },
8
+ { value: 'italy', label: 'Italy' },
9
+ ];
10
+ const response = { values: { COLLECTED: 'italy' } };
11
+ const defaultProps = {
12
+ id: 'id',
13
+ label: 'label',
14
+ handleChange,
15
+ options,
16
+ response,
17
+ };
18
+
19
+ describe('radio', () => {
20
+ it('renders without crashing', () => {
21
+ mount(<Radio {...defaultProps} />);
22
+ });
23
+
24
+ it('returns management & disabled component', () => {
25
+ shallow(<Radio {...defaultProps} management disabled />);
26
+ });
27
+ });
@@ -1,9 +1,9 @@
1
- import React from 'react';
2
- import { shallow } from 'enzyme';
3
- import { Sequence } from 'components';
4
-
5
- describe('sequence', () => {
6
- it('renders without crashing', () => {
7
- shallow(<Sequence id="module-id" label="Sequence" />);
8
- });
9
- });
1
+ import React from 'react';
2
+ import { shallow } from 'enzyme';
3
+ import { Sequence } from 'components';
4
+
5
+ describe('sequence', () => {
6
+ it('renders without crashing', () => {
7
+ shallow(<Sequence id="module-id" label="Sequence" />);
8
+ });
9
+ });
@@ -1,9 +1,9 @@
1
- import React from 'react';
2
- import { shallow } from 'enzyme';
3
- import { Subsequence } from 'components';
4
-
5
- describe('subsequence', () => {
6
- it('renders without crashing', () => {
7
- shallow(<Subsequence id="subsequence-id" label="Subsequence" />);
8
- });
9
- });
1
+ import React from 'react';
2
+ import { shallow } from 'enzyme';
3
+ import { Subsequence } from 'components';
4
+
5
+ describe('subsequence', () => {
6
+ it('renders without crashing', () => {
7
+ shallow(<Subsequence id="subsequence-id" label="Subsequence" />);
8
+ });
9
+ });
@@ -1,11 +1,11 @@
1
- import React from 'react';
2
- import { mount } from 'enzyme';
3
- import { Table } from 'components';
4
-
5
- describe('table', () => {
6
- const handleChange = jest.fn();
7
-
8
- it('renders without crashing', () => {
9
- mount(<Table id={'table-id'} handleChange={handleChange} />);
10
- });
11
- });
1
+ import React from 'react';
2
+ import { mount } from 'enzyme';
3
+ import { Table } from 'components';
4
+
5
+ describe('table', () => {
6
+ const handleChange = jest.fn();
7
+
8
+ it('renders without crashing', () => {
9
+ mount(<Table id={'table-id'} handleChange={handleChange} />);
10
+ });
11
+ });
@@ -1,18 +1,18 @@
1
- import React from 'react';
2
- import { shallow } from 'enzyme';
3
- import { Textarea } from 'components';
4
-
5
- const handleChange = jest.fn();
6
- const defaultProps = { id: 'id', label: 'label', handleChange };
7
-
8
- describe('textarea', () => {
9
- it('renders without crashing', () => {
10
- shallow(<Textarea {...defaultProps} />);
11
- });
12
- it('returns management component', () => {
13
- shallow(<Textarea {...defaultProps} label="label" management />);
14
- });
15
- it('returns disabled & readOnly component', () => {
16
- shallow(<Textarea {...defaultProps} label="label" disabled readOnly />);
17
- });
18
- });
1
+ import React from 'react';
2
+ import { shallow } from 'enzyme';
3
+ import { Textarea } from 'components';
4
+
5
+ const handleChange = jest.fn();
6
+ const defaultProps = { id: 'id', label: 'label', handleChange };
7
+
8
+ describe('textarea', () => {
9
+ it('renders without crashing', () => {
10
+ shallow(<Textarea {...defaultProps} />);
11
+ });
12
+ it('returns management component', () => {
13
+ shallow(<Textarea {...defaultProps} label="label" management />);
14
+ });
15
+ it('returns disabled & readOnly component', () => {
16
+ shallow(<Textarea {...defaultProps} label="label" disabled readOnly />);
17
+ });
18
+ });
@@ -1,25 +1,25 @@
1
- import React from 'react';
2
- import { shallow, mount } from 'enzyme';
3
- import { TooltipResponse } from 'components';
4
-
5
- const response = {
6
- name: 'Response',
7
- values: {
8
- PREVIOUS: null,
9
- COLLECTED: '1',
10
- FORCED: '0',
11
- EDITED: '1',
12
- INPUTED: null,
13
- },
14
- };
15
-
16
- describe('tooltip', () => {
17
- it('renders without crashing', () => {
18
- shallow(<TooltipResponse id="id" />);
19
- shallow(<TooltipResponse id="id" response={response} />);
20
- });
21
- it('renders firing useEffect', () => {
22
- const wrapper = mount(<TooltipResponse id="id" response={response} />);
23
- wrapper.setProps({ response: {} });
24
- });
25
- });
1
+ import React from 'react';
2
+ import { shallow, mount } from 'enzyme';
3
+ import { TooltipResponse } from 'components';
4
+
5
+ const response = {
6
+ name: 'Response',
7
+ values: {
8
+ PREVIOUS: null,
9
+ COLLECTED: '1',
10
+ FORCED: '0',
11
+ EDITED: '1',
12
+ INPUTED: null,
13
+ },
14
+ };
15
+
16
+ describe('tooltip', () => {
17
+ it('renders without crashing', () => {
18
+ shallow(<TooltipResponse id="id" />);
19
+ shallow(<TooltipResponse id="id" response={response} />);
20
+ });
21
+ it('renders firing useEffect', () => {
22
+ const wrapper = mount(<TooltipResponse id="id" response={response} />);
23
+ wrapper.setProps({ response: {} });
24
+ });
25
+ });
@@ -1,4 +1,4 @@
1
- import { configure } from 'enzyme';
2
- import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
3
-
4
- configure({ adapter: new Adapter() });
1
+ import { configure } from 'enzyme';
2
+ import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
3
+
4
+ configure({ adapter: new Adapter() });
@@ -1,36 +1,36 @@
1
- import { getAlphabet } from 'utils/lib';
2
-
3
- describe('alphabet', () => {
4
- describe('getAlphabet', () => {
5
- it('should return array of letters', () => {
6
- expect(getAlphabet()).toEqual([
7
- 'a',
8
- 'b',
9
- 'c',
10
- 'd',
11
- 'e',
12
- 'f',
13
- 'g',
14
- 'h',
15
- 'i',
16
- 'j',
17
- 'k',
18
- 'l',
19
- 'm',
20
- 'n',
21
- 'o',
22
- 'p',
23
- 'q',
24
- 'r',
25
- 's',
26
- 't',
27
- 'u',
28
- 'v',
29
- 'w',
30
- 'x',
31
- 'y',
32
- 'z',
33
- ]);
34
- });
35
- });
36
- });
1
+ import { getAlphabet } from 'utils/lib';
2
+
3
+ describe('alphabet', () => {
4
+ describe('getAlphabet', () => {
5
+ it('should return array of letters', () => {
6
+ expect(getAlphabet()).toEqual([
7
+ 'a',
8
+ 'b',
9
+ 'c',
10
+ 'd',
11
+ 'e',
12
+ 'f',
13
+ 'g',
14
+ 'h',
15
+ 'i',
16
+ 'j',
17
+ 'k',
18
+ 'l',
19
+ 'm',
20
+ 'n',
21
+ 'o',
22
+ 'p',
23
+ 'q',
24
+ 'r',
25
+ 's',
26
+ 't',
27
+ 'u',
28
+ 'v',
29
+ 'w',
30
+ 'x',
31
+ 'y',
32
+ 'z',
33
+ ]);
34
+ });
35
+ });
36
+ });
@@ -1,22 +1,22 @@
1
- import { buildNullNestedArray } from 'utils/lib';
2
-
3
- describe('array utils', () => {
4
- describe('buildNullNestedArray', () => {
5
- it('should return default', () => {
6
- expect(buildNullNestedArray()).toEqual([]);
7
- expect(buildNullNestedArray('')).toEqual([]);
8
- });
9
- it('should return null array', () => {
10
- expect(buildNullNestedArray(['5'])).toEqual([null]);
11
- expect(
12
- buildNullNestedArray([
13
- ['1.222', 3],
14
- ['1', '2'],
15
- ])
16
- ).toEqual([
17
- [null, null],
18
- [null, null],
19
- ]);
20
- });
21
- });
22
- });
1
+ import { buildNullNestedArray } from 'utils/lib';
2
+
3
+ describe('array utils', () => {
4
+ describe('buildNullNestedArray', () => {
5
+ it('should return default', () => {
6
+ expect(buildNullNestedArray()).toEqual([]);
7
+ expect(buildNullNestedArray('')).toEqual([]);
8
+ });
9
+ it('should return null array', () => {
10
+ expect(buildNullNestedArray(['5'])).toEqual([null]);
11
+ expect(
12
+ buildNullNestedArray([
13
+ ['1.222', 3],
14
+ ['1', '2'],
15
+ ])
16
+ ).toEqual([
17
+ [null, null],
18
+ [null, null],
19
+ ]);
20
+ });
21
+ });
22
+ });
@@ -1,72 +1,72 @@
1
- import { responseToClean, responsesToClean } from 'utils/lib';
2
-
3
- describe('checkbox utils', () => {
4
- describe('responseToClean', () => {
5
- it('should return default value', () => {
6
- expect(responseToClean()()).toBeFalsy();
7
- expect(responseToClean({})(['COLLECTED'])).toBeFalsy();
8
- expect(
9
- responseToClean({
10
- name: 'key',
11
- values: { COLLECTED: true, EDITED: false },
12
- })()
13
- ).toBeFalsy();
14
- });
15
- it('should return true', () => {
16
- expect(
17
- responseToClean({
18
- name: 'key',
19
- values: { COLLECTED: null, EDITED: true },
20
- })(['COLLECTED', 'EDITED'])
21
- ).toBeTruthy();
22
- });
23
- it('should return false', () => {
24
- expect(
25
- responseToClean({
26
- name: 'key',
27
- values: { COLLECTED: true, EDITED: false },
28
- })(['COLLECTED', 'EDITED'])
29
- ).toBeFalsy();
30
- });
31
- });
32
- describe('responsesToClean', () => {
33
- it('should return default value', () => {
34
- expect(responsesToClean()()()).toBeFalsy();
35
- expect(responsesToClean([])(['COLLECTED'])('')).toBeFalsy();
36
- expect(
37
- responsesToClean([
38
- { response: { name: 'key', values: { COLLECTED: true } } },
39
- ])()('key')
40
- ).toBeFalsy();
41
- expect(
42
- responsesToClean([
43
- { response: { name: 'key', values: { COLLECTED: true } } },
44
- ])(['COLLECTED'])()
45
- ).toBeFalsy();
46
- });
47
- it('should return true', () => {
48
- expect(
49
- responsesToClean([
50
- {
51
- response: {
52
- name: 'key',
53
- values: { COLLECTED: null, EDITED: true },
54
- },
55
- },
56
- ])(['COLLECTED', 'EDITED'])('key')
57
- ).toBeTruthy();
58
- });
59
- it('should return false', () => {
60
- expect(
61
- responsesToClean([
62
- {
63
- response: {
64
- name: 'key',
65
- values: { COLLECTED: true, EDITED: false },
66
- },
67
- },
68
- ])(['COLLECTED', 'EDITED'])('key')
69
- ).toBeFalsy();
70
- });
71
- });
72
- });
1
+ import { responseToClean, responsesToClean } from 'utils/lib';
2
+
3
+ describe('checkbox utils', () => {
4
+ describe('responseToClean', () => {
5
+ it('should return default value', () => {
6
+ expect(responseToClean()()).toBeFalsy();
7
+ expect(responseToClean({})(['COLLECTED'])).toBeFalsy();
8
+ expect(
9
+ responseToClean({
10
+ name: 'key',
11
+ values: { COLLECTED: true, EDITED: false },
12
+ })()
13
+ ).toBeFalsy();
14
+ });
15
+ it('should return true', () => {
16
+ expect(
17
+ responseToClean({
18
+ name: 'key',
19
+ values: { COLLECTED: null, EDITED: true },
20
+ })(['COLLECTED', 'EDITED'])
21
+ ).toBeTruthy();
22
+ });
23
+ it('should return false', () => {
24
+ expect(
25
+ responseToClean({
26
+ name: 'key',
27
+ values: { COLLECTED: true, EDITED: false },
28
+ })(['COLLECTED', 'EDITED'])
29
+ ).toBeFalsy();
30
+ });
31
+ });
32
+ describe('responsesToClean', () => {
33
+ it('should return default value', () => {
34
+ expect(responsesToClean()()()).toBeFalsy();
35
+ expect(responsesToClean([])(['COLLECTED'])('')).toBeFalsy();
36
+ expect(
37
+ responsesToClean([
38
+ { response: { name: 'key', values: { COLLECTED: true } } },
39
+ ])()('key')
40
+ ).toBeFalsy();
41
+ expect(
42
+ responsesToClean([
43
+ { response: { name: 'key', values: { COLLECTED: true } } },
44
+ ])(['COLLECTED'])()
45
+ ).toBeFalsy();
46
+ });
47
+ it('should return true', () => {
48
+ expect(
49
+ responsesToClean([
50
+ {
51
+ response: {
52
+ name: 'key',
53
+ values: { COLLECTED: null, EDITED: true },
54
+ },
55
+ },
56
+ ])(['COLLECTED', 'EDITED'])('key')
57
+ ).toBeTruthy();
58
+ });
59
+ it('should return false', () => {
60
+ expect(
61
+ responsesToClean([
62
+ {
63
+ response: {
64
+ name: 'key',
65
+ values: { COLLECTED: true, EDITED: false },
66
+ },
67
+ },
68
+ ])(['COLLECTED', 'EDITED'])('key')
69
+ ).toBeFalsy();
70
+ });
71
+ });
72
+ });
@@ -1,12 +1,12 @@
1
- import React from 'react';
2
- import { titleDecorator } from 'utils/lib';
3
- import { shallow } from 'enzyme';
4
-
5
- describe('string utils', () => {
6
- describe('titleDecorator', () => {
7
- it('renders without crashing', () => {
8
- const WrappedComponent = titleDecorator(() => <div>Component</div>);
9
- shallow(<WrappedComponent title="Component title" />);
10
- });
11
- });
12
- });
1
+ import React from 'react';
2
+ import { titleDecorator } from 'utils/lib';
3
+ import { shallow } from 'enzyme';
4
+
5
+ describe('string utils', () => {
6
+ describe('titleDecorator', () => {
7
+ it('renders without crashing', () => {
8
+ const WrappedComponent = titleDecorator(() => <div>Component</div>);
9
+ shallow(<WrappedComponent title="Component title" />);
10
+ });
11
+ });
12
+ });
@@ -1,18 +1,18 @@
1
- import { isNumberValid } from 'utils/lib';
2
-
3
- describe('input number utils', () => {
4
- describe('isNumberValid', () => {
5
- it('should return default false', () => {
6
- expect(isNumberValid('')).toBeFalsy();
7
- expect(isNumberValid('r')).toBeFalsy();
8
- expect(isNumberValid('1.')).toBeFalsy();
9
- expect(isNumberValid('1.0')).toBeFalsy();
10
- expect(isNumberValid('1.222')).toBeFalsy();
11
- expect(isNumberValid('1.222', 2)).toBeFalsy();
12
- });
13
- it('should return true', () => {
14
- expect(isNumberValid('5')).toBeTruthy();
15
- expect(isNumberValid('1.222', 3)).toBeTruthy();
16
- });
17
- });
18
- });
1
+ import { isNumberValid } from 'utils/lib';
2
+
3
+ describe('input number utils', () => {
4
+ describe('isNumberValid', () => {
5
+ it('should return default false', () => {
6
+ expect(isNumberValid('')).toBeFalsy();
7
+ expect(isNumberValid('r')).toBeFalsy();
8
+ expect(isNumberValid('1.')).toBeFalsy();
9
+ expect(isNumberValid('1.0')).toBeFalsy();
10
+ expect(isNumberValid('1.222')).toBeFalsy();
11
+ expect(isNumberValid('1.222', 2)).toBeFalsy();
12
+ });
13
+ it('should return true', () => {
14
+ expect(isNumberValid('5')).toBeTruthy();
15
+ expect(isNumberValid('1.222', 3)).toBeTruthy();
16
+ });
17
+ });
18
+ });
@@ -1,17 +1,17 @@
1
- import { getItemsPositioningClass } from 'utils/lib';
2
-
3
- describe('string utils', () => {
4
- describe('getItemsPositioningClass', () => {
5
- it('should return default value', () => {
6
- expect(getItemsPositioningClass()).toEqual('');
7
- expect(getItemsPositioningClass('')).toEqual('');
8
- expect(getItemsPositioningClass('DEFAULT')).toEqual('');
9
- expect(getItemsPositioningClass('VERTICAL')).toEqual('');
10
- });
11
- it('should return "horizontal-options"', () => {
12
- expect(getItemsPositioningClass('HORIZONTAL')).toEqual(
13
- 'horizontal-options'
14
- );
15
- });
16
- });
17
- });
1
+ import { getItemsPositioningClass } from 'utils/lib';
2
+
3
+ describe('string utils', () => {
4
+ describe('getItemsPositioningClass', () => {
5
+ it('should return default value', () => {
6
+ expect(getItemsPositioningClass()).toEqual('');
7
+ expect(getItemsPositioningClass('')).toEqual('');
8
+ expect(getItemsPositioningClass('DEFAULT')).toEqual('');
9
+ expect(getItemsPositioningClass('VERTICAL')).toEqual('');
10
+ });
11
+ it('should return "horizontal-options"', () => {
12
+ expect(getItemsPositioningClass('HORIZONTAL')).toEqual(
13
+ 'horizontal-options'
14
+ );
15
+ });
16
+ });
17
+ });
@@ -1,22 +1,22 @@
1
- import { getLabelPositionClass } from 'utils/lib';
2
-
3
- describe('string utils', () => {
4
- describe('getLabelPositionClass', () => {
5
- it('should return default value', () => {
6
- expect(getLabelPositionClass()).toEqual('label-top');
7
- expect(getLabelPositionClass('')).toEqual('label-top');
8
- });
9
- it('should return "label-top"', () => {
10
- expect(getLabelPositionClass('TOP')).toEqual('label-top');
11
- });
12
- it('should return "label-bottom"', () => {
13
- expect(getLabelPositionClass('BOTTOM')).toEqual('label-bottom');
14
- });
15
- it('should return "label-right"', () => {
16
- expect(getLabelPositionClass('RIGHT')).toEqual('label-right');
17
- });
18
- it('should return "label-left"', () => {
19
- expect(getLabelPositionClass('LEFT')).toEqual('label-left');
20
- });
21
- });
22
- });
1
+ import { getLabelPositionClass } from 'utils/lib';
2
+
3
+ describe('string utils', () => {
4
+ describe('getLabelPositionClass', () => {
5
+ it('should return default value', () => {
6
+ expect(getLabelPositionClass()).toEqual('label-top');
7
+ expect(getLabelPositionClass('')).toEqual('label-top');
8
+ });
9
+ it('should return "label-top"', () => {
10
+ expect(getLabelPositionClass('TOP')).toEqual('label-top');
11
+ });
12
+ it('should return "label-bottom"', () => {
13
+ expect(getLabelPositionClass('BOTTOM')).toEqual('label-bottom');
14
+ });
15
+ it('should return "label-right"', () => {
16
+ expect(getLabelPositionClass('RIGHT')).toEqual('label-right');
17
+ });
18
+ it('should return "label-left"', () => {
19
+ expect(getLabelPositionClass('LEFT')).toEqual('label-left');
20
+ });
21
+ });
22
+ });