@instructure/ui-buttons 10.0.1-snapshot-12 → 10.0.1-snapshot-14
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
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
|
-
## [10.0.1-snapshot-
|
|
6
|
+
## [10.0.1-snapshot-14](https://github.com/instructure/instructure-ui/compare/v10.0.0...v10.0.1-snapshot-14) (2024-08-22)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-buttons
|
|
9
9
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _circle, _Button, _Button2, _Button3, _Button4, _Button5, _Button6, _Button7, _Button8, _Button10, _Button11, _Button12, _Button13, _Button14, _Button15, _Button16, _Button17
|
|
1
|
+
var _circle, _Button, _Button2, _Button3, _Button4, _Button5, _Button6, _Button7, _Button8, _Button10, _Button11, _Button12, _Button13, _Button14, _Button15, _Button16, _Button17;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -63,13 +63,12 @@ describe('<Button/>', () => {
|
|
|
63
63
|
expect(button).toBeInTheDocument();
|
|
64
64
|
expect(button).toHaveTextContent(children);
|
|
65
65
|
});
|
|
66
|
-
it('should render a button', () => {
|
|
66
|
+
it('should render a button', async () => {
|
|
67
67
|
render(_Button || (_Button = /*#__PURE__*/React.createElement(Button, null, "Hello World")));
|
|
68
|
-
const button = screen.getByRole('button'
|
|
69
|
-
name: 'Hello World'
|
|
70
|
-
});
|
|
68
|
+
const button = screen.getByRole('button');
|
|
71
69
|
expect(button).toBeInTheDocument();
|
|
72
70
|
expect(button).toHaveAttribute('type', 'button');
|
|
71
|
+
expect(button).toHaveTextContent('Hello World');
|
|
73
72
|
});
|
|
74
73
|
it('should provide a focused getter', () => {
|
|
75
74
|
var _componentRef;
|
|
@@ -209,22 +208,15 @@ describe('<Button/>', () => {
|
|
|
209
208
|
expect(button).toBeInTheDocument();
|
|
210
209
|
expect(button).toHaveTextContent('Hello World');
|
|
211
210
|
});
|
|
212
|
-
it('should render a button', async () => {
|
|
213
|
-
render(_Button11 || (_Button11 = /*#__PURE__*/React.createElement(Button, null, "Hello World")));
|
|
214
|
-
const button = screen.getByRole('button');
|
|
215
|
-
expect(button).toBeInTheDocument();
|
|
216
|
-
expect(button).toHaveAttribute('type', 'button');
|
|
217
|
-
expect(button).toHaveTextContent('Hello World');
|
|
218
|
-
});
|
|
219
211
|
it('should not error with a null child', () => {
|
|
220
|
-
render(
|
|
212
|
+
render(_Button11 || (_Button11 = /*#__PURE__*/React.createElement(Button, null, "Hello World", null)));
|
|
221
213
|
const button = screen.getByRole('button', {
|
|
222
214
|
name: 'Hello World'
|
|
223
215
|
});
|
|
224
216
|
expect(button).toBeInTheDocument();
|
|
225
217
|
});
|
|
226
218
|
it('should render a link styled as a button if href is provided', () => {
|
|
227
|
-
render(
|
|
219
|
+
render(_Button12 || (_Button12 = /*#__PURE__*/React.createElement(Button, {
|
|
228
220
|
href: "example.html"
|
|
229
221
|
}, "Hello World")));
|
|
230
222
|
const button = screen.getAllByRole('link', {
|
|
@@ -234,7 +226,7 @@ describe('<Button/>', () => {
|
|
|
234
226
|
expect(button[0]).toHaveAttribute('href', 'example.html');
|
|
235
227
|
});
|
|
236
228
|
it('should render as a link when `to` prop is provided', () => {
|
|
237
|
-
const _render2 = render(
|
|
229
|
+
const _render2 = render(_Button13 || (_Button13 = /*#__PURE__*/React.createElement(Button, {
|
|
238
230
|
to: "/example"
|
|
239
231
|
}, "Test"))),
|
|
240
232
|
container = _render2.container;
|
|
@@ -243,7 +235,7 @@ describe('<Button/>', () => {
|
|
|
243
235
|
expect(linkButton).toHaveAttribute('to', '/example');
|
|
244
236
|
});
|
|
245
237
|
it('should render designated tag if `as` prop is specified', () => {
|
|
246
|
-
const _render3 = render(
|
|
238
|
+
const _render3 = render(_Button14 || (_Button14 = /*#__PURE__*/React.createElement(Button, {
|
|
247
239
|
as: "span"
|
|
248
240
|
}, "Hello World"))),
|
|
249
241
|
container = _render3.container;
|
|
@@ -337,7 +329,7 @@ describe('<Button/>', () => {
|
|
|
337
329
|
});
|
|
338
330
|
it('should not call onClick when button is disabled and an href prop is provided', async () => {
|
|
339
331
|
const onClick = vi.fn();
|
|
340
|
-
render(
|
|
332
|
+
render(_Button15 || (_Button15 = /*#__PURE__*/React.createElement(Button, {
|
|
341
333
|
href: "#"
|
|
342
334
|
}, "Hello World")));
|
|
343
335
|
const button = screen.getByRole('link', {
|
|
@@ -439,7 +431,7 @@ describe('<Button/>', () => {
|
|
|
439
431
|
});
|
|
440
432
|
describe('when disabled', () => {
|
|
441
433
|
it('sets the disabled attribute so that the button is not in tab order', () => {
|
|
442
|
-
render(
|
|
434
|
+
render(_Button16 || (_Button16 = /*#__PURE__*/React.createElement(Button, {
|
|
443
435
|
disabled: true
|
|
444
436
|
}, "Hello World")));
|
|
445
437
|
const button = screen.getByRole('button', {
|
|
@@ -450,7 +442,7 @@ describe('<Button/>', () => {
|
|
|
450
442
|
});
|
|
451
443
|
describe('when readOnly', () => {
|
|
452
444
|
it('sets the disabled attribute so that the button is not in tab order', () => {
|
|
453
|
-
render(
|
|
445
|
+
render(_Button17 || (_Button17 = /*#__PURE__*/React.createElement(Button, {
|
|
454
446
|
readOnly: true
|
|
455
447
|
}, "Hello World")));
|
|
456
448
|
const button = screen.getByRole('button', {
|
|
@@ -8,7 +8,7 @@ var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
|
|
8
8
|
require("@testing-library/jest-dom");
|
|
9
9
|
var _runAxeCheck = require("@instructure/ui-axe-check/lib/runAxeCheck.js");
|
|
10
10
|
var _index = require("../index");
|
|
11
|
-
var _circle, _Button, _Button2, _Button3, _Button4, _Button5, _Button6, _Button7, _Button8, _Button10, _Button11, _Button12, _Button13, _Button14, _Button15, _Button16, _Button17
|
|
11
|
+
var _circle, _Button, _Button2, _Button3, _Button4, _Button5, _Button6, _Button7, _Button8, _Button10, _Button11, _Button12, _Button13, _Button14, _Button15, _Button16, _Button17;
|
|
12
12
|
/*
|
|
13
13
|
* The MIT License (MIT)
|
|
14
14
|
*
|
|
@@ -65,13 +65,12 @@ describe('<Button/>', () => {
|
|
|
65
65
|
expect(button).toBeInTheDocument();
|
|
66
66
|
expect(button).toHaveTextContent(children);
|
|
67
67
|
});
|
|
68
|
-
it('should render a button', () => {
|
|
68
|
+
it('should render a button', async () => {
|
|
69
69
|
(0, _react2.render)(_Button || (_Button = /*#__PURE__*/_react.default.createElement(_index.Button, null, "Hello World")));
|
|
70
|
-
const button = _react2.screen.getByRole('button'
|
|
71
|
-
name: 'Hello World'
|
|
72
|
-
});
|
|
70
|
+
const button = _react2.screen.getByRole('button');
|
|
73
71
|
expect(button).toBeInTheDocument();
|
|
74
72
|
expect(button).toHaveAttribute('type', 'button');
|
|
73
|
+
expect(button).toHaveTextContent('Hello World');
|
|
75
74
|
});
|
|
76
75
|
it('should provide a focused getter', () => {
|
|
77
76
|
var _componentRef;
|
|
@@ -211,22 +210,15 @@ describe('<Button/>', () => {
|
|
|
211
210
|
expect(button).toBeInTheDocument();
|
|
212
211
|
expect(button).toHaveTextContent('Hello World');
|
|
213
212
|
});
|
|
214
|
-
it('should render a button', async () => {
|
|
215
|
-
(0, _react2.render)(_Button11 || (_Button11 = /*#__PURE__*/_react.default.createElement(_index.Button, null, "Hello World")));
|
|
216
|
-
const button = _react2.screen.getByRole('button');
|
|
217
|
-
expect(button).toBeInTheDocument();
|
|
218
|
-
expect(button).toHaveAttribute('type', 'button');
|
|
219
|
-
expect(button).toHaveTextContent('Hello World');
|
|
220
|
-
});
|
|
221
213
|
it('should not error with a null child', () => {
|
|
222
|
-
(0, _react2.render)(
|
|
214
|
+
(0, _react2.render)(_Button11 || (_Button11 = /*#__PURE__*/_react.default.createElement(_index.Button, null, "Hello World", null)));
|
|
223
215
|
const button = _react2.screen.getByRole('button', {
|
|
224
216
|
name: 'Hello World'
|
|
225
217
|
});
|
|
226
218
|
expect(button).toBeInTheDocument();
|
|
227
219
|
});
|
|
228
220
|
it('should render a link styled as a button if href is provided', () => {
|
|
229
|
-
(0, _react2.render)(
|
|
221
|
+
(0, _react2.render)(_Button12 || (_Button12 = /*#__PURE__*/_react.default.createElement(_index.Button, {
|
|
230
222
|
href: "example.html"
|
|
231
223
|
}, "Hello World")));
|
|
232
224
|
const button = _react2.screen.getAllByRole('link', {
|
|
@@ -236,7 +228,7 @@ describe('<Button/>', () => {
|
|
|
236
228
|
expect(button[0]).toHaveAttribute('href', 'example.html');
|
|
237
229
|
});
|
|
238
230
|
it('should render as a link when `to` prop is provided', () => {
|
|
239
|
-
const _render2 = (0, _react2.render)(
|
|
231
|
+
const _render2 = (0, _react2.render)(_Button13 || (_Button13 = /*#__PURE__*/_react.default.createElement(_index.Button, {
|
|
240
232
|
to: "/example"
|
|
241
233
|
}, "Test"))),
|
|
242
234
|
container = _render2.container;
|
|
@@ -245,7 +237,7 @@ describe('<Button/>', () => {
|
|
|
245
237
|
expect(linkButton).toHaveAttribute('to', '/example');
|
|
246
238
|
});
|
|
247
239
|
it('should render designated tag if `as` prop is specified', () => {
|
|
248
|
-
const _render3 = (0, _react2.render)(
|
|
240
|
+
const _render3 = (0, _react2.render)(_Button14 || (_Button14 = /*#__PURE__*/_react.default.createElement(_index.Button, {
|
|
249
241
|
as: "span"
|
|
250
242
|
}, "Hello World"))),
|
|
251
243
|
container = _render3.container;
|
|
@@ -339,7 +331,7 @@ describe('<Button/>', () => {
|
|
|
339
331
|
});
|
|
340
332
|
it('should not call onClick when button is disabled and an href prop is provided', async () => {
|
|
341
333
|
const onClick = _vitest.vi.fn();
|
|
342
|
-
(0, _react2.render)(
|
|
334
|
+
(0, _react2.render)(_Button15 || (_Button15 = /*#__PURE__*/_react.default.createElement(_index.Button, {
|
|
343
335
|
href: "#"
|
|
344
336
|
}, "Hello World")));
|
|
345
337
|
const button = _react2.screen.getByRole('link', {
|
|
@@ -441,7 +433,7 @@ describe('<Button/>', () => {
|
|
|
441
433
|
});
|
|
442
434
|
describe('when disabled', () => {
|
|
443
435
|
it('sets the disabled attribute so that the button is not in tab order', () => {
|
|
444
|
-
(0, _react2.render)(
|
|
436
|
+
(0, _react2.render)(_Button16 || (_Button16 = /*#__PURE__*/_react.default.createElement(_index.Button, {
|
|
445
437
|
disabled: true
|
|
446
438
|
}, "Hello World")));
|
|
447
439
|
const button = _react2.screen.getByRole('button', {
|
|
@@ -452,7 +444,7 @@ describe('<Button/>', () => {
|
|
|
452
444
|
});
|
|
453
445
|
describe('when readOnly', () => {
|
|
454
446
|
it('sets the disabled attribute so that the button is not in tab order', () => {
|
|
455
|
-
(0, _react2.render)(
|
|
447
|
+
(0, _react2.render)(_Button17 || (_Button17 = /*#__PURE__*/_react.default.createElement(_index.Button, {
|
|
456
448
|
readOnly: true
|
|
457
449
|
}, "Hello World")));
|
|
458
450
|
const button = _react2.screen.getByRole('button', {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-buttons",
|
|
3
|
-
"version": "10.0.1-snapshot-
|
|
3
|
+
"version": "10.0.1-snapshot-14",
|
|
4
4
|
"description": "Accessible button components",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-axe-check": "10.0.1-snapshot-
|
|
27
|
-
"@instructure/ui-babel-preset": "10.0.1-snapshot-
|
|
28
|
-
"@instructure/ui-test-utils": "10.0.1-snapshot-
|
|
29
|
-
"@instructure/ui-themes": "10.0.1-snapshot-
|
|
26
|
+
"@instructure/ui-axe-check": "10.0.1-snapshot-14",
|
|
27
|
+
"@instructure/ui-babel-preset": "10.0.1-snapshot-14",
|
|
28
|
+
"@instructure/ui-test-utils": "10.0.1-snapshot-14",
|
|
29
|
+
"@instructure/ui-themes": "10.0.1-snapshot-14",
|
|
30
30
|
"@testing-library/jest-dom": "^6.4.6",
|
|
31
31
|
"@testing-library/react": "^15.0.7",
|
|
32
32
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -34,21 +34,21 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@babel/runtime": "^7.24.5",
|
|
37
|
-
"@instructure/console": "10.0.1-snapshot-
|
|
38
|
-
"@instructure/emotion": "10.0.1-snapshot-
|
|
39
|
-
"@instructure/shared-types": "10.0.1-snapshot-
|
|
40
|
-
"@instructure/ui-a11y-content": "10.0.1-snapshot-
|
|
41
|
-
"@instructure/ui-a11y-utils": "10.0.1-snapshot-
|
|
42
|
-
"@instructure/ui-color-utils": "10.0.1-snapshot-
|
|
43
|
-
"@instructure/ui-dom-utils": "10.0.1-snapshot-
|
|
44
|
-
"@instructure/ui-icons": "10.0.1-snapshot-
|
|
45
|
-
"@instructure/ui-position": "10.0.1-snapshot-
|
|
46
|
-
"@instructure/ui-prop-types": "10.0.1-snapshot-
|
|
47
|
-
"@instructure/ui-react-utils": "10.0.1-snapshot-
|
|
48
|
-
"@instructure/ui-testable": "10.0.1-snapshot-
|
|
49
|
-
"@instructure/ui-tooltip": "10.0.1-snapshot-
|
|
50
|
-
"@instructure/ui-utils": "10.0.1-snapshot-
|
|
51
|
-
"@instructure/ui-view": "10.0.1-snapshot-
|
|
37
|
+
"@instructure/console": "10.0.1-snapshot-14",
|
|
38
|
+
"@instructure/emotion": "10.0.1-snapshot-14",
|
|
39
|
+
"@instructure/shared-types": "10.0.1-snapshot-14",
|
|
40
|
+
"@instructure/ui-a11y-content": "10.0.1-snapshot-14",
|
|
41
|
+
"@instructure/ui-a11y-utils": "10.0.1-snapshot-14",
|
|
42
|
+
"@instructure/ui-color-utils": "10.0.1-snapshot-14",
|
|
43
|
+
"@instructure/ui-dom-utils": "10.0.1-snapshot-14",
|
|
44
|
+
"@instructure/ui-icons": "10.0.1-snapshot-14",
|
|
45
|
+
"@instructure/ui-position": "10.0.1-snapshot-14",
|
|
46
|
+
"@instructure/ui-prop-types": "10.0.1-snapshot-14",
|
|
47
|
+
"@instructure/ui-react-utils": "10.0.1-snapshot-14",
|
|
48
|
+
"@instructure/ui-testable": "10.0.1-snapshot-14",
|
|
49
|
+
"@instructure/ui-tooltip": "10.0.1-snapshot-14",
|
|
50
|
+
"@instructure/ui-utils": "10.0.1-snapshot-14",
|
|
51
|
+
"@instructure/ui-view": "10.0.1-snapshot-14",
|
|
52
52
|
"keycode": "^2",
|
|
53
53
|
"prop-types": "^15.8.1"
|
|
54
54
|
},
|
|
@@ -74,13 +74,14 @@ describe('<Button/>', () => {
|
|
|
74
74
|
expect(button).toHaveTextContent(children)
|
|
75
75
|
})
|
|
76
76
|
|
|
77
|
-
it('should render a button', () => {
|
|
77
|
+
it('should render a button', async () => {
|
|
78
78
|
render(<Button>Hello World</Button>)
|
|
79
79
|
|
|
80
|
-
const button = screen.getByRole('button'
|
|
80
|
+
const button = screen.getByRole('button')
|
|
81
81
|
|
|
82
82
|
expect(button).toBeInTheDocument()
|
|
83
83
|
expect(button).toHaveAttribute('type', 'button')
|
|
84
|
+
expect(button).toHaveTextContent('Hello World')
|
|
84
85
|
})
|
|
85
86
|
|
|
86
87
|
it('should provide a focused getter', () => {
|
|
@@ -224,16 +225,6 @@ describe('<Button/>', () => {
|
|
|
224
225
|
expect(button).toHaveTextContent('Hello World')
|
|
225
226
|
})
|
|
226
227
|
|
|
227
|
-
it('should render a button', async () => {
|
|
228
|
-
render(<Button>Hello World</Button>)
|
|
229
|
-
|
|
230
|
-
const button = screen.getByRole('button')
|
|
231
|
-
|
|
232
|
-
expect(button).toBeInTheDocument()
|
|
233
|
-
expect(button).toHaveAttribute('type', 'button')
|
|
234
|
-
expect(button).toHaveTextContent('Hello World')
|
|
235
|
-
})
|
|
236
|
-
|
|
237
228
|
it('should not error with a null child', () => {
|
|
238
229
|
render(<Button>Hello World{null}</Button>)
|
|
239
230
|
|