@instructure/ui-list 10.19.2-snapshot-2 → 10.19.2-snapshot-4

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.
@@ -1,57 +0,0 @@
1
- var _InlineListItem, _InlineListItem2;
2
- /*
3
- * The MIT License (MIT)
4
- *
5
- * Copyright (c) 2015 - present Instructure, Inc.
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8
- * of this software and associated documentation files (the "Software"), to deal
9
- * in the Software without restriction, including without limitation the rights
10
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- * copies of the Software, and to permit persons to whom the Software is
12
- * furnished to do so, subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in all
15
- * copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- * SOFTWARE.
24
- */
25
-
26
- import '@testing-library/jest-dom';
27
- import { render, screen } from '@testing-library/react';
28
- import { vi } from 'vitest';
29
- import { InlineListItem } from '../index';
30
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
31
- describe('<InlineListItem />', () => {
32
- it('should render children', async () => {
33
- render(_InlineListItem || (_InlineListItem = _jsx(InlineListItem, {
34
- children: "hello"
35
- })));
36
- const listItem = screen.getByRole('listitem');
37
- expect(listItem).toHaveTextContent('hello');
38
- });
39
- it('should render delimiter', async () => {
40
- const _render = render(_InlineListItem2 || (_InlineListItem2 = _jsx(InlineListItem, {
41
- delimiter: "slash",
42
- children: "List item"
43
- }))),
44
- container = _render.container;
45
- const listItem = container.querySelector('span[class$="delimiter"]');
46
- expect(listItem).toHaveAttribute('aria-hidden', 'true');
47
- });
48
- it('should call elementRef', async () => {
49
- const elementRef = vi.fn();
50
- render(_jsx(InlineListItem, {
51
- elementRef: elementRef,
52
- children: "List item"
53
- }));
54
- const listItem = screen.getByRole('listitem');
55
- expect(elementRef).toHaveBeenCalledWith(listItem);
56
- });
57
- });
@@ -1,128 +0,0 @@
1
- var _InlineList, _InlineList2, _InlineList3, _InlineList4, _InlineList5;
2
- /*
3
- * The MIT License (MIT)
4
- *
5
- * Copyright (c) 2015 - present Instructure, Inc.
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8
- * of this software and associated documentation files (the "Software"), to deal
9
- * in the Software without restriction, including without limitation the rights
10
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- * copies of the Software, and to permit persons to whom the Software is
12
- * furnished to do so, subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in all
15
- * copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- * SOFTWARE.
24
- */
25
-
26
- import '@testing-library/jest-dom';
27
- import { render, screen } from '@testing-library/react';
28
- import { vi } from 'vitest';
29
- import { InlineList } from '../index';
30
- import { runAxeCheck } from '@instructure/ui-axe-check';
31
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
32
- describe('<InlineList />', () => {
33
- let consoleWarningMock;
34
- let consoleErrorMock;
35
- beforeEach(() => {
36
- // Mocking console to prevent test output pollution and expect for messages
37
- consoleWarningMock = vi.spyOn(console, 'warn').mockImplementation(() => {});
38
- consoleErrorMock = vi.spyOn(console, 'error').mockImplementation(() => {});
39
- });
40
- afterEach(() => {
41
- consoleWarningMock.mockRestore();
42
- consoleErrorMock.mockRestore();
43
- });
44
- it('should render list items and filter out null/falsy children', async () => {
45
- render(_InlineList || (_InlineList = _jsxs(InlineList, {
46
- children: [_jsx(InlineList.Item, {
47
- children: "List item 1"
48
- }), _jsx(InlineList.Item, {
49
- children: "List item 2"
50
- }), _jsx(InlineList.Item, {
51
- children: "List item 3"
52
- }), _jsx(InlineList.Item, {
53
- children: "List item 4"
54
- }), null, false]
55
- })));
56
- const listItems = screen.getAllByRole('listitem');
57
- expect(listItems.length).toEqual(4);
58
- });
59
- it('should render a delimiter when delimiter="pipe"', async () => {
60
- const _render = render(_InlineList2 || (_InlineList2 = _jsxs(InlineList, {
61
- delimiter: "pipe",
62
- children: [_jsx(InlineList.Item, {
63
- children: "List item 1"
64
- }), _jsx(InlineList.Item, {
65
- children: "List item 2"
66
- }), _jsx(InlineList.Item, {
67
- children: "List item 3"
68
- }), _jsx(InlineList.Item, {
69
- children: "List item 4"
70
- })]
71
- }))),
72
- container = _render.container;
73
- const delimiters = container.querySelectorAll('span[aria-hidden="true"]');
74
- expect(delimiters.length).toEqual(4);
75
- delimiters.forEach(delimiter => {
76
- expect(delimiter.getAttribute('class')).toContain('inlineListItem__delimiter');
77
- });
78
- });
79
- it('should warn when itemSpacing is set when delimiter is set to anything other than none', async () => {
80
- render(_InlineList3 || (_InlineList3 = _jsxs(InlineList, {
81
- delimiter: "pipe",
82
- itemSpacing: "large",
83
- children: [_jsx(InlineList.Item, {
84
- children: "List item 1"
85
- }), _jsx(InlineList.Item, {
86
- children: "List item 2"
87
- }), _jsx(InlineList.Item, {
88
- children: "List item 3"
89
- }), _jsx(InlineList.Item, {
90
- children: "List item 4"
91
- })]
92
- })));
93
- const warning = `Warning: [InlineList] \`itemSpacing\` has no effect inside Lists with the \`delimiter\` prop set to anything other than \`none\`.`;
94
- expect(consoleErrorMock.mock.calls[0][0]).toBe(warning);
95
- });
96
- it('should render an ordered list', async () => {
97
- render(_InlineList4 || (_InlineList4 = _jsxs(InlineList, {
98
- as: "ol",
99
- children: [_jsx(InlineList.Item, {
100
- children: "List item 1"
101
- }), _jsx(InlineList.Item, {
102
- children: "List item 2"
103
- }), _jsx(InlineList.Item, {
104
- children: "List item 3"
105
- }), _jsx(InlineList.Item, {
106
- children: "List item 4"
107
- })]
108
- })));
109
- const list = screen.getByRole('list');
110
- expect(list.tagName).toBe('OL');
111
- });
112
- it('should meet a11y standards', async () => {
113
- const _render2 = render(_InlineList5 || (_InlineList5 = _jsxs(InlineList, {
114
- children: [_jsx(InlineList.Item, {
115
- children: "List item 1"
116
- }), _jsx(InlineList.Item, {
117
- children: "List item 2"
118
- }), _jsx(InlineList.Item, {
119
- children: "List item 3"
120
- }), _jsx(InlineList.Item, {
121
- children: "List item 4"
122
- })]
123
- }))),
124
- container = _render2.container;
125
- const axeCheck = await runAxeCheck(container);
126
- expect(axeCheck).toBe(true);
127
- });
128
- });
@@ -1,48 +0,0 @@
1
- var _ListItem;
2
- /*
3
- * The MIT License (MIT)
4
- *
5
- * Copyright (c) 2015 - present Instructure, Inc.
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8
- * of this software and associated documentation files (the "Software"), to deal
9
- * in the Software without restriction, including without limitation the rights
10
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- * copies of the Software, and to permit persons to whom the Software is
12
- * furnished to do so, subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in all
15
- * copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- * SOFTWARE.
24
- */
25
-
26
- import '@testing-library/jest-dom';
27
- import { render, screen } from '@testing-library/react';
28
- import { vi } from 'vitest';
29
- import { ListItem } from '../index';
30
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
31
- describe('<ListItem />', () => {
32
- it('should render children', async () => {
33
- render(_ListItem || (_ListItem = _jsx(ListItem, {
34
- children: "hello"
35
- })));
36
- const listItem = screen.getByRole('listitem');
37
- expect(listItem).toHaveTextContent('hello');
38
- });
39
- it('should call elementRef', async () => {
40
- const elementRef = vi.fn();
41
- render(_jsx(ListItem, {
42
- elementRef: elementRef,
43
- children: "List item"
44
- }));
45
- const listItem = screen.getByRole('listitem');
46
- expect(elementRef).toHaveBeenCalledWith(listItem);
47
- });
48
- });
@@ -1,108 +0,0 @@
1
- var _List, _List2, _List3, _List4;
2
- /*
3
- * The MIT License (MIT)
4
- *
5
- * Copyright (c) 2015 - present Instructure, Inc.
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8
- * of this software and associated documentation files (the "Software"), to deal
9
- * in the Software without restriction, including without limitation the rights
10
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- * copies of the Software, and to permit persons to whom the Software is
12
- * furnished to do so, subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in all
15
- * copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- * SOFTWARE.
24
- */
25
-
26
- import '@testing-library/jest-dom';
27
- import { render, screen } from '@testing-library/react';
28
- import { vi } from 'vitest';
29
- import { List } from '../index';
30
- import { runAxeCheck } from '@instructure/ui-axe-check';
31
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
32
- describe('<List />', () => {
33
- let consoleWarningMock;
34
- let consoleErrorMock;
35
- beforeEach(() => {
36
- // Mocking console to prevent test output pollution and expect for messages
37
- consoleWarningMock = vi.spyOn(console, 'warn').mockImplementation(() => {});
38
- consoleErrorMock = vi.spyOn(console, 'error').mockImplementation(() => {});
39
- });
40
- afterEach(() => {
41
- consoleWarningMock.mockRestore();
42
- consoleErrorMock.mockRestore();
43
- });
44
- it('should render list items and filter out null/falsy children', async () => {
45
- render(_List || (_List = _jsxs(List, {
46
- children: [_jsx(List.Item, {
47
- children: "List item 1"
48
- }), _jsx(List.Item, {
49
- children: "List item 2"
50
- }), _jsx(List.Item, {
51
- children: "List item 3"
52
- }), _jsx(List.Item, {
53
- children: "List item 4"
54
- }), null, false]
55
- })));
56
- const listItems = screen.getAllByRole('listitem');
57
- expect(listItems.length).toEqual(4);
58
- });
59
- it('should warn when itemSpacing is set when delimiter is set to anything other than none', async () => {
60
- render(_List2 || (_List2 = _jsxs(List, {
61
- delimiter: "dashed",
62
- itemSpacing: "large",
63
- children: [_jsx(List.Item, {
64
- children: "List item 1"
65
- }), _jsx(List.Item, {
66
- children: "List item 2"
67
- }), _jsx(List.Item, {
68
- children: "List item 3"
69
- }), _jsx(List.Item, {
70
- children: "List item 4"
71
- })]
72
- })));
73
- const warning = `Warning: [List] \`itemSpacing\` has no effect inside Lists with the \`delimiter\` prop set to anything other than \`none\`.`;
74
- expect(consoleErrorMock.mock.calls[0][0]).toBe(warning);
75
- });
76
- it('should render an ordered list', async () => {
77
- render(_List3 || (_List3 = _jsxs(List, {
78
- as: "ol",
79
- children: [_jsx(List.Item, {
80
- children: "List item 1"
81
- }), _jsx(List.Item, {
82
- children: "List item 2"
83
- }), _jsx(List.Item, {
84
- children: "List item 3"
85
- }), _jsx(List.Item, {
86
- children: "List item 4"
87
- })]
88
- })));
89
- const list = screen.getByRole('list');
90
- expect(list.tagName).toBe('OL');
91
- });
92
- it('should meet a11y standards', async () => {
93
- const _render = render(_List4 || (_List4 = _jsxs(List, {
94
- children: [_jsx(List.Item, {
95
- children: "List item 1"
96
- }), _jsx(List.Item, {
97
- children: "List item 2"
98
- }), _jsx(List.Item, {
99
- children: "List item 3"
100
- }), _jsx(List.Item, {
101
- children: "List item 4"
102
- })]
103
- }))),
104
- container = _render.container;
105
- const axeCheck = await runAxeCheck(container);
106
- expect(axeCheck).toBe(true);
107
- });
108
- });
@@ -1,58 +0,0 @@
1
- "use strict";
2
-
3
- require("@testing-library/jest-dom");
4
- var _react = require("@testing-library/react");
5
- var _vitest = require("vitest");
6
- var _index = require("../index");
7
- var _jsxRuntime = require("@emotion/react/jsx-runtime");
8
- var _InlineListItem, _InlineListItem2;
9
- /*
10
- * The MIT License (MIT)
11
- *
12
- * Copyright (c) 2015 - present Instructure, Inc.
13
- *
14
- * Permission is hereby granted, free of charge, to any person obtaining a copy
15
- * of this software and associated documentation files (the "Software"), to deal
16
- * in the Software without restriction, including without limitation the rights
17
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
- * copies of the Software, and to permit persons to whom the Software is
19
- * furnished to do so, subject to the following conditions:
20
- *
21
- * The above copyright notice and this permission notice shall be included in all
22
- * copies or substantial portions of the Software.
23
- *
24
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
- * SOFTWARE.
31
- */
32
- describe('<InlineListItem />', () => {
33
- it('should render children', async () => {
34
- (0, _react.render)(_InlineListItem || (_InlineListItem = (0, _jsxRuntime.jsx)(_index.InlineListItem, {
35
- children: "hello"
36
- })));
37
- const listItem = _react.screen.getByRole('listitem');
38
- expect(listItem).toHaveTextContent('hello');
39
- });
40
- it('should render delimiter', async () => {
41
- const _render = (0, _react.render)(_InlineListItem2 || (_InlineListItem2 = (0, _jsxRuntime.jsx)(_index.InlineListItem, {
42
- delimiter: "slash",
43
- children: "List item"
44
- }))),
45
- container = _render.container;
46
- const listItem = container.querySelector('span[class$="delimiter"]');
47
- expect(listItem).toHaveAttribute('aria-hidden', 'true');
48
- });
49
- it('should call elementRef', async () => {
50
- const elementRef = _vitest.vi.fn();
51
- (0, _react.render)((0, _jsxRuntime.jsx)(_index.InlineListItem, {
52
- elementRef: elementRef,
53
- children: "List item"
54
- }));
55
- const listItem = _react.screen.getByRole('listitem');
56
- expect(elementRef).toHaveBeenCalledWith(listItem);
57
- });
58
- });
@@ -1,129 +0,0 @@
1
- "use strict";
2
-
3
- require("@testing-library/jest-dom");
4
- var _react = require("@testing-library/react");
5
- var _vitest = require("vitest");
6
- var _index = require("../index");
7
- var _runAxeCheck = require("@instructure/ui-axe-check/lib/runAxeCheck.js");
8
- var _jsxRuntime = require("@emotion/react/jsx-runtime");
9
- var _InlineList, _InlineList2, _InlineList3, _InlineList4, _InlineList5;
10
- /*
11
- * The MIT License (MIT)
12
- *
13
- * Copyright (c) 2015 - present Instructure, Inc.
14
- *
15
- * Permission is hereby granted, free of charge, to any person obtaining a copy
16
- * of this software and associated documentation files (the "Software"), to deal
17
- * in the Software without restriction, including without limitation the rights
18
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19
- * copies of the Software, and to permit persons to whom the Software is
20
- * furnished to do so, subject to the following conditions:
21
- *
22
- * The above copyright notice and this permission notice shall be included in all
23
- * copies or substantial portions of the Software.
24
- *
25
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
- * SOFTWARE.
32
- */
33
- describe('<InlineList />', () => {
34
- let consoleWarningMock;
35
- let consoleErrorMock;
36
- beforeEach(() => {
37
- // Mocking console to prevent test output pollution and expect for messages
38
- consoleWarningMock = _vitest.vi.spyOn(console, 'warn').mockImplementation(() => {});
39
- consoleErrorMock = _vitest.vi.spyOn(console, 'error').mockImplementation(() => {});
40
- });
41
- afterEach(() => {
42
- consoleWarningMock.mockRestore();
43
- consoleErrorMock.mockRestore();
44
- });
45
- it('should render list items and filter out null/falsy children', async () => {
46
- (0, _react.render)(_InlineList || (_InlineList = (0, _jsxRuntime.jsxs)(_index.InlineList, {
47
- children: [(0, _jsxRuntime.jsx)(_index.InlineList.Item, {
48
- children: "List item 1"
49
- }), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
50
- children: "List item 2"
51
- }), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
52
- children: "List item 3"
53
- }), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
54
- children: "List item 4"
55
- }), null, false]
56
- })));
57
- const listItems = _react.screen.getAllByRole('listitem');
58
- expect(listItems.length).toEqual(4);
59
- });
60
- it('should render a delimiter when delimiter="pipe"', async () => {
61
- const _render = (0, _react.render)(_InlineList2 || (_InlineList2 = (0, _jsxRuntime.jsxs)(_index.InlineList, {
62
- delimiter: "pipe",
63
- children: [(0, _jsxRuntime.jsx)(_index.InlineList.Item, {
64
- children: "List item 1"
65
- }), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
66
- children: "List item 2"
67
- }), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
68
- children: "List item 3"
69
- }), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
70
- children: "List item 4"
71
- })]
72
- }))),
73
- container = _render.container;
74
- const delimiters = container.querySelectorAll('span[aria-hidden="true"]');
75
- expect(delimiters.length).toEqual(4);
76
- delimiters.forEach(delimiter => {
77
- expect(delimiter.getAttribute('class')).toContain('inlineListItem__delimiter');
78
- });
79
- });
80
- it('should warn when itemSpacing is set when delimiter is set to anything other than none', async () => {
81
- (0, _react.render)(_InlineList3 || (_InlineList3 = (0, _jsxRuntime.jsxs)(_index.InlineList, {
82
- delimiter: "pipe",
83
- itemSpacing: "large",
84
- children: [(0, _jsxRuntime.jsx)(_index.InlineList.Item, {
85
- children: "List item 1"
86
- }), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
87
- children: "List item 2"
88
- }), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
89
- children: "List item 3"
90
- }), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
91
- children: "List item 4"
92
- })]
93
- })));
94
- const warning = `Warning: [InlineList] \`itemSpacing\` has no effect inside Lists with the \`delimiter\` prop set to anything other than \`none\`.`;
95
- expect(consoleErrorMock.mock.calls[0][0]).toBe(warning);
96
- });
97
- it('should render an ordered list', async () => {
98
- (0, _react.render)(_InlineList4 || (_InlineList4 = (0, _jsxRuntime.jsxs)(_index.InlineList, {
99
- as: "ol",
100
- children: [(0, _jsxRuntime.jsx)(_index.InlineList.Item, {
101
- children: "List item 1"
102
- }), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
103
- children: "List item 2"
104
- }), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
105
- children: "List item 3"
106
- }), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
107
- children: "List item 4"
108
- })]
109
- })));
110
- const list = _react.screen.getByRole('list');
111
- expect(list.tagName).toBe('OL');
112
- });
113
- it('should meet a11y standards', async () => {
114
- const _render2 = (0, _react.render)(_InlineList5 || (_InlineList5 = (0, _jsxRuntime.jsxs)(_index.InlineList, {
115
- children: [(0, _jsxRuntime.jsx)(_index.InlineList.Item, {
116
- children: "List item 1"
117
- }), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
118
- children: "List item 2"
119
- }), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
120
- children: "List item 3"
121
- }), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
122
- children: "List item 4"
123
- })]
124
- }))),
125
- container = _render2.container;
126
- const axeCheck = await (0, _runAxeCheck.runAxeCheck)(container);
127
- expect(axeCheck).toBe(true);
128
- });
129
- });
@@ -1,49 +0,0 @@
1
- "use strict";
2
-
3
- require("@testing-library/jest-dom");
4
- var _react = require("@testing-library/react");
5
- var _vitest = require("vitest");
6
- var _index = require("../index");
7
- var _jsxRuntime = require("@emotion/react/jsx-runtime");
8
- var _ListItem;
9
- /*
10
- * The MIT License (MIT)
11
- *
12
- * Copyright (c) 2015 - present Instructure, Inc.
13
- *
14
- * Permission is hereby granted, free of charge, to any person obtaining a copy
15
- * of this software and associated documentation files (the "Software"), to deal
16
- * in the Software without restriction, including without limitation the rights
17
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
- * copies of the Software, and to permit persons to whom the Software is
19
- * furnished to do so, subject to the following conditions:
20
- *
21
- * The above copyright notice and this permission notice shall be included in all
22
- * copies or substantial portions of the Software.
23
- *
24
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
- * SOFTWARE.
31
- */
32
- describe('<ListItem />', () => {
33
- it('should render children', async () => {
34
- (0, _react.render)(_ListItem || (_ListItem = (0, _jsxRuntime.jsx)(_index.ListItem, {
35
- children: "hello"
36
- })));
37
- const listItem = _react.screen.getByRole('listitem');
38
- expect(listItem).toHaveTextContent('hello');
39
- });
40
- it('should call elementRef', async () => {
41
- const elementRef = _vitest.vi.fn();
42
- (0, _react.render)((0, _jsxRuntime.jsx)(_index.ListItem, {
43
- elementRef: elementRef,
44
- children: "List item"
45
- }));
46
- const listItem = _react.screen.getByRole('listitem');
47
- expect(elementRef).toHaveBeenCalledWith(listItem);
48
- });
49
- });