@truedat/ai 7.0.8 → 7.1.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/ai",
3
- "version": "7.0.8",
3
+ "version": "7.1.0",
4
4
  "description": "Truedat Web Artificial Intelligence package",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -35,7 +35,7 @@
35
35
  "@testing-library/react": "^12.0.0",
36
36
  "@testing-library/react-hooks": "^8.0.1",
37
37
  "@testing-library/user-event": "^13.2.1",
38
- "@truedat/test": "5.12.2",
38
+ "@truedat/test": "7.1.0",
39
39
  "babel-jest": "^28.1.0",
40
40
  "babel-plugin-dynamic-import-node": "^2.3.3",
41
41
  "babel-plugin-lodash": "^3.3.4",
@@ -44,6 +44,7 @@
44
44
  "identity-obj-proxy": "^3.0.0",
45
45
  "jest": "^29.0.0",
46
46
  "jest-environment-jsdom": "^29.0.0",
47
+ "jsdom": "^26.0.0",
47
48
  "react": "^16.14.0",
48
49
  "react-dom": "^16.14.0",
49
50
  "rimraf": "^3.0.2",
@@ -84,11 +85,10 @@
84
85
  ]
85
86
  },
86
87
  "dependencies": {
87
- "@truedat/core": "7.0.8",
88
+ "@truedat/core": "7.1.0",
88
89
  "prop-types": "^15.8.1",
89
90
  "react-hook-form": "^7.45.4",
90
91
  "react-intl": "^5.20.10",
91
- "react-router-dom": "^5.2.0",
92
92
  "semantic-ui-react": "^2.1.4",
93
93
  "swr": "^2.0.0"
94
94
  },
@@ -97,5 +97,5 @@
97
97
  "react-dom": ">= 16.8.6 < 17",
98
98
  "semantic-ui-react": ">= 2.0.3 < 2.2"
99
99
  },
100
- "gitHead": "ff536a41caac4df0cfa13df66dc2805b3bb7637a"
100
+ "gitHead": "cb08380da04c7286e694540bc24d32f01a728dfc"
101
101
  }
@@ -13,8 +13,8 @@ import ActionDetail from "./ActionDetail";
13
13
  export const ActionHeader = ({ action, actionMutate }) => {
14
14
  const { formatMessage } = useIntl();
15
15
  const buildStatusMessage = (status, icon, color) => (
16
- <p>
17
- <Icon name={icon} color={color} fitted />{" "}
16
+ <p className="flex-gapped">
17
+ <Icon name={icon} color={color} fitted />
18
18
  {formatMessage({ id: `ai.actions.is_enabled.${status}` })}
19
19
  </p>
20
20
  );
@@ -91,7 +91,7 @@ jest.mock("@truedat/ai/hooks/useActions", () => ({
91
91
  action,
92
92
  })),
93
93
  useActionUpdate: jest.fn(() => ({
94
- trigger: jest.fn(() => new Promise(() => {})),
94
+ trigger: jest.fn(() => Promise.resolve()),
95
95
  })),
96
96
  }));
97
97
 
@@ -82,22 +82,29 @@ describe("<ActionNew />", () => {
82
82
  setActionResource,
83
83
  };
84
84
  it("matches the latest snapshot", async () => {
85
- const { queryByText, container } = render(
85
+ const { container, queryByText } = render(
86
86
  <ActionNew {...props} />,
87
87
  renderOpts
88
88
  );
89
89
 
90
- await waitFor(() => expect(queryByText(/lazy/i)).not.toBeInTheDocument());
90
+ await waitFor(() => {
91
+ expect(queryByText(/lazy/i)).not.toBeInTheDocument();
92
+ expect(container.querySelector(".loader")).not.toBeInTheDocument();
93
+ });
91
94
  expect(container).toMatchSnapshot();
92
95
  });
93
96
 
94
97
  it("matches the latest snapshot", async () => {
95
- const { queryByText, container } = render(
98
+ const { container, queryByText } = render(
96
99
  <ActionNew {...props} />,
97
100
  renderOpts
98
101
  );
99
102
 
100
- await waitFor(() => expect(queryByText(/lazy/i)).not.toBeInTheDocument());
103
+ await waitFor(() => {
104
+ expect(queryByText(/lazy/i)).not.toBeInTheDocument();
105
+ expect(container.querySelector(".loader")).not.toBeInTheDocument();
106
+ });
107
+
101
108
  expect(container).toMatchSnapshot();
102
109
  });
103
110
 
@@ -106,7 +113,15 @@ describe("<ActionNew />", () => {
106
113
  isEnabled: true,
107
114
  onSubmit: jest.fn(),
108
115
  };
109
- const { getByRole } = render(<ActionNew {...props} />, renderOpts);
116
+ const { container, queryByText, getByRole } = render(
117
+ <ActionNew {...props} />,
118
+ renderOpts
119
+ );
120
+
121
+ await waitFor(() => {
122
+ expect(queryByText(/lazy/i)).not.toBeInTheDocument();
123
+ expect(container.querySelector(".loader")).not.toBeInTheDocument();
124
+ });
110
125
 
111
126
  expect(getByRole("button", { name: /create/i })).not.toBeEnabled();
112
127
  });
@@ -46,12 +46,13 @@ exports[`<Action /> matches the latest snapshot 1`] = `
46
46
  <div
47
47
  class="sub header"
48
48
  >
49
- <p>
49
+ <p
50
+ class="flex-gapped"
51
+ >
50
52
  <i
51
53
  aria-hidden="true"
52
54
  class="green play fitted icon"
53
55
  />
54
-
55
56
  Active
56
57
  </p>
57
58
  </div>
@@ -62,6 +63,7 @@ exports[`<Action /> matches the latest snapshot 1`] = `
62
63
  class="right aligned eight wide column"
63
64
  >
64
65
  <div
66
+ aria-disabled="false"
65
67
  aria-expanded="false"
66
68
  class="ui floating dropdown button icon group-actions"
67
69
  role="listbox"
@@ -3,6 +3,7 @@
3
3
  exports[`<ActionActions /> matches the latest snapshot 1`] = `
4
4
  <div>
5
5
  <div
6
+ aria-disabled="false"
6
7
  aria-expanded="false"
7
8
  class="ui floating dropdown button icon group-actions"
8
9
  role="listbox"