@instructure/ui-breadcrumb 9.2.1-snapshot-1 → 9.2.1-snapshot-3
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 +1 -1
- package/es/Breadcrumb/BreadcrumbLink/__new-tests__/BreadcrumbLink.test.js +13 -13
- package/es/Breadcrumb/__new-tests__/Breadcrumb.test.js +11 -11
- package/lib/Breadcrumb/BreadcrumbLink/__new-tests__/BreadcrumbLink.test.js +13 -13
- package/lib/Breadcrumb/__new-tests__/Breadcrumb.test.js +11 -11
- package/package.json +17 -16
- package/src/Breadcrumb/BreadcrumbLink/__new-tests__/BreadcrumbLink.test.tsx +19 -15
- package/src/Breadcrumb/__new-tests__/Breadcrumb.test.tsx +18 -13
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Breadcrumb/BreadcrumbLink/__new-tests__/BreadcrumbLink.test.d.ts.map +1 -1
- package/types/Breadcrumb/__new-tests__/Breadcrumb.test.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [9.2.1-snapshot-
|
|
6
|
+
## [9.2.1-snapshot-3](https://github.com/instructure/instructure-ui/compare/v9.2.0...v9.2.1-snapshot-3) (2024-07-12)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-breadcrumb
|
|
9
9
|
|
|
@@ -25,21 +25,24 @@ var _BreadcrumbLink, _BreadcrumbLink2, _BreadcrumbLink3, _BreadcrumbLink4, _Brea
|
|
|
25
25
|
|
|
26
26
|
import React from 'react';
|
|
27
27
|
import { fireEvent, render, screen } from '@testing-library/react';
|
|
28
|
+
import { vi } from 'vitest';
|
|
28
29
|
import '@testing-library/jest-dom';
|
|
29
30
|
import { runAxeCheck } from '@instructure/ui-axe-check';
|
|
30
31
|
import { BreadcrumbLink } from '../index';
|
|
31
32
|
const TEST_TEXT_01 = 'Account';
|
|
32
33
|
const TEST_LINK = 'http://instructure-test.com';
|
|
33
34
|
const TEST_TO = '/example';
|
|
34
|
-
const originalResizeObserver = global.ResizeObserver;
|
|
35
35
|
describe('<BreadcrumbLink />', () => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
let consoleWarningMock;
|
|
37
|
+
let consoleErrorMock;
|
|
38
|
+
beforeEach(() => {
|
|
39
|
+
// Mocking console to prevent test output pollution
|
|
40
|
+
consoleWarningMock = vi.spyOn(console, 'warn').mockImplementation(() => {});
|
|
41
|
+
consoleErrorMock = vi.spyOn(console, 'error').mockImplementation(() => {});
|
|
42
|
+
});
|
|
43
|
+
afterEach(() => {
|
|
44
|
+
consoleWarningMock.mockRestore();
|
|
45
|
+
consoleErrorMock.mockRestore();
|
|
43
46
|
});
|
|
44
47
|
it('should render an anchor tag when given a href prop', () => {
|
|
45
48
|
render(_BreadcrumbLink || (_BreadcrumbLink = /*#__PURE__*/React.createElement(BreadcrumbLink, {
|
|
@@ -49,7 +52,7 @@ describe('<BreadcrumbLink />', () => {
|
|
|
49
52
|
expect(anchor).toHaveAttribute('href', TEST_LINK);
|
|
50
53
|
});
|
|
51
54
|
it('should render as a button and respond to onClick event', () => {
|
|
52
|
-
const onClick =
|
|
55
|
+
const onClick = vi.fn();
|
|
53
56
|
render( /*#__PURE__*/React.createElement(BreadcrumbLink, {
|
|
54
57
|
onClick: onClick
|
|
55
58
|
}, TEST_TEXT_01));
|
|
@@ -58,7 +61,7 @@ describe('<BreadcrumbLink />', () => {
|
|
|
58
61
|
expect(onClick).toHaveBeenCalledTimes(1);
|
|
59
62
|
});
|
|
60
63
|
it('should respond to mouseEnter event when provided with onMouseEnter prop', () => {
|
|
61
|
-
const onMouseEnter =
|
|
64
|
+
const onMouseEnter = vi.fn();
|
|
62
65
|
render( /*#__PURE__*/React.createElement(BreadcrumbLink, {
|
|
63
66
|
onMouseEnter: onMouseEnter,
|
|
64
67
|
href: TEST_LINK
|
|
@@ -110,7 +113,4 @@ describe('<BreadcrumbLink />', () => {
|
|
|
110
113
|
const axeCheck = await runAxeCheck(container);
|
|
111
114
|
expect(axeCheck).toBe(true);
|
|
112
115
|
});
|
|
113
|
-
afterAll(() => {
|
|
114
|
-
global.ResizeObserver = originalResizeObserver;
|
|
115
|
-
});
|
|
116
116
|
});
|
|
@@ -25,6 +25,7 @@ var _Breadcrumb, _Breadcrumb2, _Breadcrumb3;
|
|
|
25
25
|
|
|
26
26
|
import React from 'react';
|
|
27
27
|
import { render, screen } from '@testing-library/react';
|
|
28
|
+
import { vi } from 'vitest';
|
|
28
29
|
import '@testing-library/jest-dom';
|
|
29
30
|
|
|
30
31
|
// eslint-disable-next-line no-restricted-imports
|
|
@@ -36,15 +37,17 @@ const TEST_LABEL = 'You are here:';
|
|
|
36
37
|
const TEST_TEXT_01 = 'Account';
|
|
37
38
|
const TEST_TEXT_02 = 'Settings';
|
|
38
39
|
const TEST_LINK = 'http://instructure-test.com';
|
|
39
|
-
const originalResizeObserver = global.ResizeObserver;
|
|
40
40
|
describe('<Breadcrumb />', () => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
let consoleWarningMock;
|
|
42
|
+
let consoleErrorMock;
|
|
43
|
+
beforeEach(() => {
|
|
44
|
+
// Mocking console to prevent test output pollution and expect for messages
|
|
45
|
+
consoleWarningMock = vi.spyOn(console, 'warn').mockImplementation(() => {});
|
|
46
|
+
consoleErrorMock = vi.spyOn(console, 'error').mockImplementation(() => {});
|
|
47
|
+
});
|
|
48
|
+
afterEach(() => {
|
|
49
|
+
consoleWarningMock.mockRestore();
|
|
50
|
+
consoleErrorMock.mockRestore();
|
|
48
51
|
});
|
|
49
52
|
it('should be accessible', async () => {
|
|
50
53
|
const _render = render(_Breadcrumb || (_Breadcrumb = /*#__PURE__*/React.createElement(Breadcrumb, {
|
|
@@ -86,7 +89,4 @@ describe('<Breadcrumb />', () => {
|
|
|
86
89
|
expect(icon).toBeInTheDocument();
|
|
87
90
|
expect(icon).toHaveAttribute('aria-hidden', 'true');
|
|
88
91
|
});
|
|
89
|
-
afterAll(() => {
|
|
90
|
-
global.ResizeObserver = originalResizeObserver;
|
|
91
|
-
});
|
|
92
92
|
});
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
var _react = _interopRequireDefault(require("react"));
|
|
5
5
|
var _react2 = require("@testing-library/react");
|
|
6
|
+
var _vitest = require("vitest");
|
|
6
7
|
require("@testing-library/jest-dom");
|
|
7
8
|
var _runAxeCheck = require("@instructure/ui-axe-check/lib/runAxeCheck.js");
|
|
8
9
|
var _index = require("../index");
|
|
@@ -33,15 +34,17 @@ var _BreadcrumbLink, _BreadcrumbLink2, _BreadcrumbLink3, _BreadcrumbLink4, _Brea
|
|
|
33
34
|
const TEST_TEXT_01 = 'Account';
|
|
34
35
|
const TEST_LINK = 'http://instructure-test.com';
|
|
35
36
|
const TEST_TO = '/example';
|
|
36
|
-
const originalResizeObserver = global.ResizeObserver;
|
|
37
37
|
describe('<BreadcrumbLink />', () => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
let consoleWarningMock;
|
|
39
|
+
let consoleErrorMock;
|
|
40
|
+
beforeEach(() => {
|
|
41
|
+
// Mocking console to prevent test output pollution
|
|
42
|
+
consoleWarningMock = _vitest.vi.spyOn(console, 'warn').mockImplementation(() => {});
|
|
43
|
+
consoleErrorMock = _vitest.vi.spyOn(console, 'error').mockImplementation(() => {});
|
|
44
|
+
});
|
|
45
|
+
afterEach(() => {
|
|
46
|
+
consoleWarningMock.mockRestore();
|
|
47
|
+
consoleErrorMock.mockRestore();
|
|
45
48
|
});
|
|
46
49
|
it('should render an anchor tag when given a href prop', () => {
|
|
47
50
|
(0, _react2.render)(_BreadcrumbLink || (_BreadcrumbLink = /*#__PURE__*/_react.default.createElement(_index.BreadcrumbLink, {
|
|
@@ -51,7 +54,7 @@ describe('<BreadcrumbLink />', () => {
|
|
|
51
54
|
expect(anchor).toHaveAttribute('href', TEST_LINK);
|
|
52
55
|
});
|
|
53
56
|
it('should render as a button and respond to onClick event', () => {
|
|
54
|
-
const onClick =
|
|
57
|
+
const onClick = _vitest.vi.fn();
|
|
55
58
|
(0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.BreadcrumbLink, {
|
|
56
59
|
onClick: onClick
|
|
57
60
|
}, TEST_TEXT_01));
|
|
@@ -60,7 +63,7 @@ describe('<BreadcrumbLink />', () => {
|
|
|
60
63
|
expect(onClick).toHaveBeenCalledTimes(1);
|
|
61
64
|
});
|
|
62
65
|
it('should respond to mouseEnter event when provided with onMouseEnter prop', () => {
|
|
63
|
-
const onMouseEnter =
|
|
66
|
+
const onMouseEnter = _vitest.vi.fn();
|
|
64
67
|
(0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.BreadcrumbLink, {
|
|
65
68
|
onMouseEnter: onMouseEnter,
|
|
66
69
|
href: TEST_LINK
|
|
@@ -112,7 +115,4 @@ describe('<BreadcrumbLink />', () => {
|
|
|
112
115
|
const axeCheck = await (0, _runAxeCheck.runAxeCheck)(container);
|
|
113
116
|
expect(axeCheck).toBe(true);
|
|
114
117
|
});
|
|
115
|
-
afterAll(() => {
|
|
116
|
-
global.ResizeObserver = originalResizeObserver;
|
|
117
|
-
});
|
|
118
118
|
});
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
var _react = _interopRequireDefault(require("react"));
|
|
5
5
|
var _react2 = require("@testing-library/react");
|
|
6
|
+
var _vitest = require("vitest");
|
|
6
7
|
require("@testing-library/jest-dom");
|
|
7
8
|
var _generateA11yTests = require("@instructure/ui-scripts/lib/test/generateA11yTests");
|
|
8
9
|
var _runAxeCheck = require("@instructure/ui-axe-check/lib/runAxeCheck.js");
|
|
@@ -37,15 +38,17 @@ const TEST_LABEL = 'You are here:';
|
|
|
37
38
|
const TEST_TEXT_01 = 'Account';
|
|
38
39
|
const TEST_TEXT_02 = 'Settings';
|
|
39
40
|
const TEST_LINK = 'http://instructure-test.com';
|
|
40
|
-
const originalResizeObserver = global.ResizeObserver;
|
|
41
41
|
describe('<Breadcrumb />', () => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
let consoleWarningMock;
|
|
43
|
+
let consoleErrorMock;
|
|
44
|
+
beforeEach(() => {
|
|
45
|
+
// Mocking console to prevent test output pollution and expect for messages
|
|
46
|
+
consoleWarningMock = _vitest.vi.spyOn(console, 'warn').mockImplementation(() => {});
|
|
47
|
+
consoleErrorMock = _vitest.vi.spyOn(console, 'error').mockImplementation(() => {});
|
|
48
|
+
});
|
|
49
|
+
afterEach(() => {
|
|
50
|
+
consoleWarningMock.mockRestore();
|
|
51
|
+
consoleErrorMock.mockRestore();
|
|
49
52
|
});
|
|
50
53
|
it('should be accessible', async () => {
|
|
51
54
|
const _render = (0, _react2.render)(_Breadcrumb || (_Breadcrumb = /*#__PURE__*/_react.default.createElement(_index.Breadcrumb, {
|
|
@@ -87,7 +90,4 @@ describe('<Breadcrumb />', () => {
|
|
|
87
90
|
expect(icon).toBeInTheDocument();
|
|
88
91
|
expect(icon).toHaveAttribute('aria-hidden', 'true');
|
|
89
92
|
});
|
|
90
|
-
afterAll(() => {
|
|
91
|
-
global.ResizeObserver = originalResizeObserver;
|
|
92
|
-
});
|
|
93
93
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-breadcrumb",
|
|
3
|
-
"version": "9.2.1-snapshot-
|
|
3
|
+
"version": "9.2.1-snapshot-3",
|
|
4
4
|
"description": "A breadcrumb component",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,25 +23,26 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-axe-check": "9.2.1-snapshot-
|
|
27
|
-
"@instructure/ui-babel-preset": "9.2.1-snapshot-
|
|
28
|
-
"@instructure/ui-scripts": "9.2.1-snapshot-
|
|
29
|
-
"@instructure/ui-themes": "9.2.1-snapshot-
|
|
26
|
+
"@instructure/ui-axe-check": "9.2.1-snapshot-3",
|
|
27
|
+
"@instructure/ui-babel-preset": "9.2.1-snapshot-3",
|
|
28
|
+
"@instructure/ui-scripts": "9.2.1-snapshot-3",
|
|
29
|
+
"@instructure/ui-themes": "9.2.1-snapshot-3",
|
|
30
30
|
"@testing-library/jest-dom": "^6.4.5",
|
|
31
|
-
"@testing-library/react": "^15.0.7"
|
|
31
|
+
"@testing-library/react": "^15.0.7",
|
|
32
|
+
"vitest": "^1.6.0"
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|
|
34
35
|
"@babel/runtime": "^7.24.5",
|
|
35
|
-
"@instructure/emotion": "9.2.1-snapshot-
|
|
36
|
-
"@instructure/shared-types": "9.2.1-snapshot-
|
|
37
|
-
"@instructure/ui-icons": "9.2.1-snapshot-
|
|
38
|
-
"@instructure/ui-link": "9.2.1-snapshot-
|
|
39
|
-
"@instructure/ui-prop-types": "9.2.1-snapshot-
|
|
40
|
-
"@instructure/ui-react-utils": "9.2.1-snapshot-
|
|
41
|
-
"@instructure/ui-testable": "9.2.1-snapshot-
|
|
42
|
-
"@instructure/ui-truncate-text": "9.2.1-snapshot-
|
|
43
|
-
"@instructure/ui-utils": "9.2.1-snapshot-
|
|
44
|
-
"@instructure/ui-view": "9.2.1-snapshot-
|
|
36
|
+
"@instructure/emotion": "9.2.1-snapshot-3",
|
|
37
|
+
"@instructure/shared-types": "9.2.1-snapshot-3",
|
|
38
|
+
"@instructure/ui-icons": "9.2.1-snapshot-3",
|
|
39
|
+
"@instructure/ui-link": "9.2.1-snapshot-3",
|
|
40
|
+
"@instructure/ui-prop-types": "9.2.1-snapshot-3",
|
|
41
|
+
"@instructure/ui-react-utils": "9.2.1-snapshot-3",
|
|
42
|
+
"@instructure/ui-testable": "9.2.1-snapshot-3",
|
|
43
|
+
"@instructure/ui-truncate-text": "9.2.1-snapshot-3",
|
|
44
|
+
"@instructure/ui-utils": "9.2.1-snapshot-3",
|
|
45
|
+
"@instructure/ui-view": "9.2.1-snapshot-3",
|
|
45
46
|
"prop-types": "^15.8.1"
|
|
46
47
|
},
|
|
47
48
|
"peerDependencies": {
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
import React from 'react'
|
|
26
26
|
import { fireEvent, render, screen } from '@testing-library/react'
|
|
27
|
+
import { vi } from 'vitest'
|
|
27
28
|
import '@testing-library/jest-dom'
|
|
28
29
|
|
|
29
30
|
import { runAxeCheck } from '@instructure/ui-axe-check'
|
|
@@ -33,16 +34,23 @@ const TEST_TEXT_01 = 'Account'
|
|
|
33
34
|
const TEST_LINK = 'http://instructure-test.com'
|
|
34
35
|
const TEST_TO = '/example'
|
|
35
36
|
|
|
36
|
-
const originalResizeObserver = global.ResizeObserver
|
|
37
|
-
|
|
38
37
|
describe('<BreadcrumbLink />', () => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
let consoleWarningMock: ReturnType<typeof vi.spyOn>
|
|
39
|
+
let consoleErrorMock: ReturnType<typeof vi.spyOn>
|
|
40
|
+
|
|
41
|
+
beforeEach(() => {
|
|
42
|
+
// Mocking console to prevent test output pollution
|
|
43
|
+
consoleWarningMock = vi
|
|
44
|
+
.spyOn(console, 'warn')
|
|
45
|
+
.mockImplementation(() => {}) as any
|
|
46
|
+
consoleErrorMock = vi
|
|
47
|
+
.spyOn(console, 'error')
|
|
48
|
+
.mockImplementation(() => {}) as any
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
afterEach(() => {
|
|
52
|
+
consoleWarningMock.mockRestore()
|
|
53
|
+
consoleErrorMock.mockRestore()
|
|
46
54
|
})
|
|
47
55
|
|
|
48
56
|
it('should render an anchor tag when given a href prop', () => {
|
|
@@ -53,7 +61,7 @@ describe('<BreadcrumbLink />', () => {
|
|
|
53
61
|
})
|
|
54
62
|
|
|
55
63
|
it('should render as a button and respond to onClick event', () => {
|
|
56
|
-
const onClick =
|
|
64
|
+
const onClick = vi.fn()
|
|
57
65
|
|
|
58
66
|
render(<BreadcrumbLink onClick={onClick}>{TEST_TEXT_01}</BreadcrumbLink>)
|
|
59
67
|
const button = screen.getByRole('button')
|
|
@@ -64,7 +72,7 @@ describe('<BreadcrumbLink />', () => {
|
|
|
64
72
|
})
|
|
65
73
|
|
|
66
74
|
it('should respond to mouseEnter event when provided with onMouseEnter prop', () => {
|
|
67
|
-
const onMouseEnter =
|
|
75
|
+
const onMouseEnter = vi.fn()
|
|
68
76
|
|
|
69
77
|
render(
|
|
70
78
|
<BreadcrumbLink onMouseEnter={onMouseEnter} href={TEST_LINK}>
|
|
@@ -130,8 +138,4 @@ describe('<BreadcrumbLink />', () => {
|
|
|
130
138
|
|
|
131
139
|
expect(axeCheck).toBe(true)
|
|
132
140
|
})
|
|
133
|
-
|
|
134
|
-
afterAll(() => {
|
|
135
|
-
global.ResizeObserver = originalResizeObserver
|
|
136
|
-
})
|
|
137
141
|
})
|
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
|
|
25
25
|
import React from 'react'
|
|
26
26
|
import { render, screen } from '@testing-library/react'
|
|
27
|
+
import { vi } from 'vitest'
|
|
28
|
+
import type { MockInstance } from 'vitest'
|
|
27
29
|
import '@testing-library/jest-dom'
|
|
28
30
|
|
|
29
31
|
// eslint-disable-next-line no-restricted-imports
|
|
@@ -37,16 +39,23 @@ const TEST_TEXT_01 = 'Account'
|
|
|
37
39
|
const TEST_TEXT_02 = 'Settings'
|
|
38
40
|
const TEST_LINK = 'http://instructure-test.com'
|
|
39
41
|
|
|
40
|
-
const originalResizeObserver = global.ResizeObserver
|
|
41
|
-
|
|
42
42
|
describe('<Breadcrumb />', () => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
let consoleWarningMock: ReturnType<typeof vi.spyOn>
|
|
44
|
+
let consoleErrorMock: ReturnType<typeof vi.spyOn>
|
|
45
|
+
|
|
46
|
+
beforeEach(() => {
|
|
47
|
+
// Mocking console to prevent test output pollution and expect for messages
|
|
48
|
+
consoleWarningMock = vi
|
|
49
|
+
.spyOn(console, 'warn')
|
|
50
|
+
.mockImplementation(() => {}) as MockInstance
|
|
51
|
+
consoleErrorMock = vi
|
|
52
|
+
.spyOn(console, 'error')
|
|
53
|
+
.mockImplementation(() => {}) as MockInstance
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
afterEach(() => {
|
|
57
|
+
consoleWarningMock.mockRestore()
|
|
58
|
+
consoleErrorMock.mockRestore()
|
|
50
59
|
})
|
|
51
60
|
|
|
52
61
|
it('should be accessible', async () => {
|
|
@@ -102,8 +111,4 @@ describe('<Breadcrumb />', () => {
|
|
|
102
111
|
expect(icon).toBeInTheDocument()
|
|
103
112
|
expect(icon).toHaveAttribute('aria-hidden', 'true')
|
|
104
113
|
})
|
|
105
|
-
|
|
106
|
-
afterAll(() => {
|
|
107
|
-
global.ResizeObserver = originalResizeObserver
|
|
108
|
-
})
|
|
109
114
|
})
|