@truedat/audit 6.5.5 → 6.6.1

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/audit",
3
- "version": "6.5.5",
3
+ "version": "6.6.1",
4
4
  "description": "Truedat Web Audit Module",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -34,7 +34,7 @@
34
34
  "@testing-library/jest-dom": "^5.16.5",
35
35
  "@testing-library/react": "^12.0.0",
36
36
  "@testing-library/user-event": "^13.2.1",
37
- "@truedat/test": "6.5.5",
37
+ "@truedat/test": "6.6.1",
38
38
  "babel-jest": "^28.1.0",
39
39
  "babel-plugin-dynamic-import-node": "^2.3.3",
40
40
  "babel-plugin-lodash": "^3.3.4",
@@ -84,8 +84,8 @@
84
84
  ]
85
85
  },
86
86
  "dependencies": {
87
- "@truedat/auth": "6.5.5",
88
- "@truedat/core": "6.5.5",
87
+ "@truedat/auth": "6.6.1",
88
+ "@truedat/core": "6.6.1",
89
89
  "moment": "^2.29.4",
90
90
  "path-to-regexp": "^1.7.0",
91
91
  "prop-types": "^15.8.1",
@@ -107,5 +107,5 @@
107
107
  "react-dom": ">= 16.8.6 < 17",
108
108
  "semantic-ui-react": ">= 2.0.3 < 2.2"
109
109
  },
110
- "gitHead": "b55faef0ee852d0d2282c29272d3c7cb530be45a"
110
+ "gitHead": "2fa84eee80136fa3bd394c04153e6f16d2e5a1e0"
111
111
  }
@@ -2,38 +2,17 @@ import React from "react";
2
2
  import { waitFor } from "@testing-library/react";
3
3
  import { render } from "@truedat/test/render";
4
4
  import userEvent from "@testing-library/user-event";
5
- import { domainsMock } from "@truedat/test/mocks";
6
- import en from "../../messages/en";
5
+ import {
6
+ domainsMock,
7
+ mockUseStructures,
8
+ mockUseConcepts,
9
+ } from "@truedat/test/mocks";
10
+ import SearchContextWrapper from "@truedat/core/components/common/SearchContextWrapper";
7
11
  import SubscriptionForm from "../SubscriptionForm";
12
+ import en from "../../messages/en";
8
13
 
9
- jest.mock("@truedat/bg/concepts/hooks/useConcepts", () => {
10
- const originalModule = jest.requireActual(
11
- "@truedat/bg/concepts/hooks/useConcepts"
12
- );
13
-
14
- return {
15
- __esModule: true,
16
- ...originalModule,
17
- useConceptFilters: () => ({
18
- trigger: () => ({
19
- then: (callback) =>
20
- callback({
21
- data: [],
22
- }),
23
- }),
24
- }),
25
-
26
- useConceptVersionsSearch: () => ({
27
- trigger: () => ({
28
- then: (callback) =>
29
- callback({
30
- data: [],
31
- headers: {},
32
- }),
33
- }),
34
- }),
35
- };
36
- });
14
+ mockUseStructures();
15
+ mockUseConcepts();
37
16
 
38
17
  const structureActiveFilters = {};
39
18
  const roles = [{ name: "role1" }, { name: "role2" }];
@@ -83,12 +62,18 @@ const messages = {
83
62
  "structures.not_found.header": "Nothing found...",
84
63
  "structures.search.placeholder": "Search structures...",
85
64
  "search.placeholder": "Search...",
65
+ "structures.loading.header": "Loading structures...",
86
66
  },
87
67
  };
88
68
 
89
69
  const variables = { action: "manageSubscriptions" };
90
70
  const mocks = [domainsMock(variables), domainsMock(variables)];
91
71
  const renderOpts = { state, mocks, messages };
72
+ const searchProps = {
73
+ loading: false,
74
+ searchParams: {},
75
+ searchData: { data: [] },
76
+ };
92
77
 
93
78
  describe("<SubscriptionForm />", () => {
94
79
  it("matches the latest snapshot", async () => {
@@ -101,7 +86,9 @@ describe("<SubscriptionForm />", () => {
101
86
  const onSubmit = jest.fn();
102
87
  const props = { onSubmit };
103
88
  const { getByRole, findByText, queryByTestId, queryByText } = render(
104
- <SubscriptionForm {...props} />,
89
+ <SearchContextWrapper props={searchProps}>
90
+ <SubscriptionForm {...props} />
91
+ </SearchContextWrapper>,
105
92
  renderOpts
106
93
  );
107
94
  await waitFor(() => {