@tsed/react-formio 1.10.10 → 1.10.11
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/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +7 -5
- package/dist/index.modern.js.map +1 -1
- package/package.json +4 -4
- package/src/components/actions-table/actionsTable.component.spec.tsx +15 -17
- package/src/components/actions-table/actionsTable.component.tsx +1 -0
- package/src/components/form-settings/formSettings.component.tsx +1 -0
- package/src/components/input-text/inputText.component.tsx +1 -1
- package/src/components/loader/loader.component.spec.tsx +2 -2
- package/src/components/loader/loader.component.tsx +1 -1
- package/src/components/select/select.component.tsx +1 -1
- package/src/components/table/filters/defaultColumnFilter.component.spec.tsx +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/react-formio",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.11",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.modern.js",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"prettier": "prettier '{src,test}/**/*.{ts,tsx}' --write"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@tsed/redux-utils": "1.10.
|
|
16
|
+
"@tsed/redux-utils": "1.10.11",
|
|
17
17
|
"eventemitter2": "^6.4.3",
|
|
18
18
|
"prop-types": "^15.7.2"
|
|
19
19
|
},
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"tooltip.js": "^1.3.3"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@tsed/tailwind": "1.10.
|
|
32
|
-
"@tsed/tailwind-formio": "1.10.
|
|
31
|
+
"@tsed/tailwind": "1.10.11",
|
|
32
|
+
"@tsed/tailwind-formio": "1.10.11",
|
|
33
33
|
"eslint-plugin-jsx-a11y": "^6.5.1"
|
|
34
34
|
},
|
|
35
35
|
"repository": "https://github.com/TypedProject/tsed-formio",
|
|
@@ -8,32 +8,30 @@ describe("ActionsTable", () => {
|
|
|
8
8
|
it("should render the table actions", async () => {
|
|
9
9
|
const onAddAction = jest.fn();
|
|
10
10
|
|
|
11
|
-
const {
|
|
11
|
+
const { getByRole, getAllByRole } = render(
|
|
12
12
|
<Sandbox {...Sandbox.args} onAddAction={onAddAction} />
|
|
13
13
|
);
|
|
14
14
|
|
|
15
|
-
const btn =
|
|
15
|
+
const btn = getByRole("button", { name: /add action/i });
|
|
16
16
|
const cells = getAllByRole("cell");
|
|
17
|
-
const
|
|
17
|
+
const options = getAllByRole("option");
|
|
18
18
|
|
|
19
|
-
expect(btn).
|
|
20
|
-
expect(btn).
|
|
21
|
-
expect(cells[0]).
|
|
22
|
-
expect(
|
|
23
|
-
Sandbox.args.availableActions.length + 1
|
|
24
|
-
);
|
|
19
|
+
expect(btn).toHaveProperty("disabled");
|
|
20
|
+
expect(btn.innerHTML).toMatch("Add action");
|
|
21
|
+
expect(cells[0].innerHTML).toMatch("Save Submission");
|
|
22
|
+
expect(options.length).toEqual(Sandbox.args.availableActions.length + 1);
|
|
25
23
|
|
|
26
|
-
expect(
|
|
27
|
-
expect(
|
|
24
|
+
expect(options[0].innerHTML).toMatch("Select an action");
|
|
25
|
+
expect(options[1].innerHTML).toMatch("Email");
|
|
28
26
|
});
|
|
29
27
|
it("should not call addAction when the default item is selected", async () => {
|
|
30
28
|
const onAddAction = jest.fn();
|
|
31
29
|
|
|
32
|
-
const {
|
|
30
|
+
const { getByRole } = render(
|
|
33
31
|
<Sandbox {...Sandbox.args} onAddAction={onAddAction} />
|
|
34
32
|
);
|
|
35
33
|
|
|
36
|
-
const btn =
|
|
34
|
+
const btn = getByRole("button", { name: /add action/i });
|
|
37
35
|
|
|
38
36
|
await fireEvent.click(btn);
|
|
39
37
|
expect(onAddAction).not.toHaveBeenCalled();
|
|
@@ -41,12 +39,12 @@ describe("ActionsTable", () => {
|
|
|
41
39
|
it("should call addAction with the selected action", async () => {
|
|
42
40
|
const onAddAction = jest.fn();
|
|
43
41
|
|
|
44
|
-
const {
|
|
42
|
+
const { getByRole } = render(
|
|
45
43
|
<Sandbox {...Sandbox.args} onAddAction={onAddAction} />
|
|
46
44
|
);
|
|
47
45
|
|
|
48
|
-
const btn =
|
|
49
|
-
const select =
|
|
46
|
+
const btn = getByRole("button", { name: /add action/i });
|
|
47
|
+
const select = getByRole("combobox");
|
|
50
48
|
|
|
51
49
|
await userEvent.selectOptions(
|
|
52
50
|
select,
|
|
@@ -55,7 +53,7 @@ describe("ActionsTable", () => {
|
|
|
55
53
|
|
|
56
54
|
await fireEvent.click(btn);
|
|
57
55
|
|
|
58
|
-
expect(btn).not.
|
|
56
|
+
expect(btn).not.toHaveProperty("disabled", true);
|
|
59
57
|
expect(onAddAction).toHaveBeenCalledWith("webhook");
|
|
60
58
|
});
|
|
61
59
|
});
|
|
@@ -53,6 +53,7 @@ export function ActionsTable({
|
|
|
53
53
|
disabled={currentAction === ""}
|
|
54
54
|
className={"btn btn-success"}
|
|
55
55
|
onClick={() => currentAction && onAddAction(currentAction)}
|
|
56
|
+
type={"submit"}
|
|
56
57
|
>
|
|
57
58
|
<i className={classnames(iconClass(undefined, "plus"), "mr-1")} />{" "}
|
|
58
59
|
{i18n("Add action")}
|
|
@@ -6,7 +6,7 @@ describe("Loader", () => {
|
|
|
6
6
|
it("should render a component (with isActive = true)", () => {
|
|
7
7
|
const { getByTestId } = render(<Loader isActive={true} />);
|
|
8
8
|
|
|
9
|
-
const icon = getByTestId("
|
|
9
|
+
const icon = getByTestId("icon_radio-circle");
|
|
10
10
|
|
|
11
11
|
expect(icon).toBeTruthy();
|
|
12
12
|
});
|
|
@@ -14,7 +14,7 @@ describe("Loader", () => {
|
|
|
14
14
|
it("should render a component (with isActive = false)", () => {
|
|
15
15
|
const { queryByTestId } = render(<Loader isActive={false} />);
|
|
16
16
|
|
|
17
|
-
const icon = queryByTestId("
|
|
17
|
+
const icon = queryByTestId("icon_radio-circle");
|
|
18
18
|
|
|
19
19
|
expect(icon).toBeFalsy();
|
|
20
20
|
});
|
|
@@ -12,13 +12,13 @@ describe("DefaultColumnFilter", () => {
|
|
|
12
12
|
column: { id: "id", filterValue: "", setFilter: jest.fn() }
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
const {
|
|
15
|
+
const { getByRole } = render(
|
|
16
16
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
17
17
|
// @ts-ignore
|
|
18
18
|
<DefaultColumnFilter {...props} />
|
|
19
19
|
);
|
|
20
20
|
|
|
21
|
-
const input =
|
|
21
|
+
const input = getByRole("textbox");
|
|
22
22
|
|
|
23
23
|
await act(async () => {
|
|
24
24
|
fireEvent.change(input, { target: { value: "value-test" } });
|