@khanacademy/wonder-blocks-dropdown 2.10.2 → 2.10.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.
- package/CHANGELOG.md +27 -0
- package/package.json +10 -10
- package/src/components/__tests__/action-item.test.js +12 -6
- package/src/components/__tests__/dropdown-core.test.js +4 -4
- package/dist/index.js +0 -3502
- package/docs.md +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-dropdown
|
|
2
2
|
|
|
3
|
+
## 2.10.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @khanacademy/wonder-blocks-clickable@2.4.3
|
|
8
|
+
- @khanacademy/wonder-blocks-core@4.6.1
|
|
9
|
+
- @khanacademy/wonder-blocks-icon@1.2.34
|
|
10
|
+
- @khanacademy/wonder-blocks-layout@1.4.14
|
|
11
|
+
- @khanacademy/wonder-blocks-modal@3.0.4
|
|
12
|
+
- @khanacademy/wonder-blocks-search-field@1.0.16
|
|
13
|
+
- @khanacademy/wonder-blocks-typography@1.1.36
|
|
14
|
+
|
|
15
|
+
## 2.10.3
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [b561425a]
|
|
20
|
+
- Updated dependencies [a566e232]
|
|
21
|
+
- Updated dependencies [d2b21a6e]
|
|
22
|
+
- @khanacademy/wonder-blocks-core@4.6.0
|
|
23
|
+
- @khanacademy/wonder-blocks-clickable@2.4.2
|
|
24
|
+
- @khanacademy/wonder-blocks-icon@1.2.33
|
|
25
|
+
- @khanacademy/wonder-blocks-layout@1.4.13
|
|
26
|
+
- @khanacademy/wonder-blocks-modal@3.0.3
|
|
27
|
+
- @khanacademy/wonder-blocks-search-field@1.0.15
|
|
28
|
+
- @khanacademy/wonder-blocks-typography@1.1.35
|
|
29
|
+
|
|
3
30
|
## 2.10.2
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khanacademy/wonder-blocks-dropdown",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.4",
|
|
4
4
|
"design": "v1",
|
|
5
5
|
"description": "Dropdown variants for Wonder Blocks.",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@babel/runtime": "^7.18.6",
|
|
19
|
-
"@khanacademy/wonder-blocks-clickable": "^2.4.
|
|
19
|
+
"@khanacademy/wonder-blocks-clickable": "^2.4.3",
|
|
20
20
|
"@khanacademy/wonder-blocks-color": "^1.2.0",
|
|
21
|
-
"@khanacademy/wonder-blocks-core": "^4.
|
|
22
|
-
"@khanacademy/wonder-blocks-icon": "^1.2.
|
|
23
|
-
"@khanacademy/wonder-blocks-layout": "^1.4.
|
|
24
|
-
"@khanacademy/wonder-blocks-modal": "^3.0.
|
|
25
|
-
"@khanacademy/wonder-blocks-search-field": "^1.0.
|
|
21
|
+
"@khanacademy/wonder-blocks-core": "^4.6.1",
|
|
22
|
+
"@khanacademy/wonder-blocks-icon": "^1.2.34",
|
|
23
|
+
"@khanacademy/wonder-blocks-layout": "^1.4.14",
|
|
24
|
+
"@khanacademy/wonder-blocks-modal": "^3.0.4",
|
|
25
|
+
"@khanacademy/wonder-blocks-search-field": "^1.0.16",
|
|
26
26
|
"@khanacademy/wonder-blocks-spacing": "^3.0.5",
|
|
27
27
|
"@khanacademy/wonder-blocks-timing": "^2.1.0",
|
|
28
|
-
"@khanacademy/wonder-blocks-typography": "^1.1.
|
|
28
|
+
"@khanacademy/wonder-blocks-typography": "^1.1.36"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@popperjs/core": "^2.10.1",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"react-window": "^1.8.5"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@khanacademy/wonder-blocks-button": "^3.0.
|
|
42
|
-
"wb-dev-build-settings": "^0.
|
|
41
|
+
"@khanacademy/wonder-blocks-button": "^3.0.11",
|
|
42
|
+
"wb-dev-build-settings": "^0.6.0"
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import {MemoryRouter, Link} from "react-router-dom";
|
|
4
|
-
import {mount} from "enzyme";
|
|
5
3
|
import {render, screen} from "@testing-library/react";
|
|
4
|
+
import * as ReactRouterDOM from "react-router-dom";
|
|
6
5
|
|
|
7
6
|
import ActionItem from "../action-item.js";
|
|
8
7
|
|
|
8
|
+
jest.mock("react-router-dom", () => ({
|
|
9
|
+
__esModule: true,
|
|
10
|
+
...jest.requireActual("react-router-dom"),
|
|
11
|
+
Link: jest.fn().mockReturnValue(<a href="/link">some link</a>),
|
|
12
|
+
}));
|
|
13
|
+
|
|
9
14
|
describe("ActionItem", () => {
|
|
10
15
|
it("should render with disabled styles", () => {
|
|
11
16
|
// Arrange
|
|
@@ -30,16 +35,17 @@ describe("ActionItem", () => {
|
|
|
30
35
|
|
|
31
36
|
it("should render a Link if there's a router", () => {
|
|
32
37
|
// Arrange
|
|
38
|
+
const linkSpy = jest.spyOn(ReactRouterDOM, "Link");
|
|
33
39
|
|
|
34
40
|
// Act
|
|
35
|
-
|
|
36
|
-
<MemoryRouter>
|
|
41
|
+
render(
|
|
42
|
+
<ReactRouterDOM.MemoryRouter>
|
|
37
43
|
<ActionItem href="/foo" label="Example" />
|
|
38
|
-
</MemoryRouter>,
|
|
44
|
+
</ReactRouterDOM.MemoryRouter>,
|
|
39
45
|
);
|
|
40
46
|
|
|
41
47
|
// Assert
|
|
42
|
-
expect(
|
|
48
|
+
expect(linkSpy).toHaveBeenCalled();
|
|
43
49
|
});
|
|
44
50
|
|
|
45
51
|
it("should set the lang attribute if it's passed down", () => {
|
|
@@ -613,11 +613,11 @@ describe("DropdownCore", () => {
|
|
|
613
613
|
);
|
|
614
614
|
|
|
615
615
|
// Act
|
|
616
|
-
userEvent.
|
|
616
|
+
userEvent.tab();
|
|
617
617
|
|
|
618
618
|
// Assert
|
|
619
619
|
expect(handleOpen).toHaveBeenCalledTimes(0);
|
|
620
|
-
waitFor(() => {
|
|
620
|
+
await waitFor(() => {
|
|
621
621
|
expect(
|
|
622
622
|
screen.getByRole("button", {name: "Clear search"}),
|
|
623
623
|
).toHaveFocus();
|
|
@@ -699,7 +699,7 @@ describe("DropdownCore", () => {
|
|
|
699
699
|
const searchField = await screen.findByPlaceholderText("Filter");
|
|
700
700
|
|
|
701
701
|
// Assert
|
|
702
|
-
waitFor(() => {
|
|
702
|
+
await waitFor(() => {
|
|
703
703
|
expect(searchField).toHaveFocus();
|
|
704
704
|
});
|
|
705
705
|
});
|
|
@@ -730,7 +730,7 @@ describe("DropdownCore", () => {
|
|
|
730
730
|
userEvent.click(item);
|
|
731
731
|
|
|
732
732
|
// Assert
|
|
733
|
-
waitFor(() => {
|
|
733
|
+
await waitFor(() => {
|
|
734
734
|
expect(item).toHaveFocus();
|
|
735
735
|
});
|
|
736
736
|
});
|