@truedat/dd 4.43.4 → 4.44.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.
Files changed (73) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +6 -6
  3. package/src/api/fragments.js +10 -0
  4. package/src/api/mutations.js +28 -0
  5. package/src/api/queries.js +20 -0
  6. package/src/api.js +0 -4
  7. package/src/components/DictionaryRoutes.js +2 -10
  8. package/src/components/LinkStructureTagForm.js +2 -2
  9. package/src/components/LinkedStructureTag.js +16 -7
  10. package/src/components/StructureLinkTagButton.js +8 -11
  11. package/src/components/StructureSummary.js +1 -1
  12. package/src/components/StructureTag.js +59 -20
  13. package/src/components/StructureTagForm.js +30 -35
  14. package/src/components/StructureTags.js +7 -6
  15. package/src/components/StructureTagsCards.js +56 -59
  16. package/src/components/StructureTagsCrumbs.js +4 -4
  17. package/src/components/StructureTagsRoutes.js +33 -57
  18. package/src/components/StructuresRoutes.js +0 -3
  19. package/src/components/TagsHeader.js +14 -21
  20. package/src/components/__tests__/PendingStructureNoteRow.spec.js +5 -1
  21. package/src/components/__tests__/PendingStructureNotes.spec.js +2 -2
  22. package/src/components/__tests__/StructureTag.spec.js +4 -1
  23. package/src/components/__tests__/StructureTagForm.spec.js +40 -82
  24. package/src/components/__tests__/StructureTags.spec.js +7 -7
  25. package/src/components/__tests__/StructureTagsCards.spec.js +38 -36
  26. package/src/components/__tests__/StructuresUploadEventsTable.spec.js +36 -42
  27. package/src/components/__tests__/__snapshots__/DictionaryRoutes.spec.js.snap +3 -3
  28. package/src/components/__tests__/__snapshots__/PendingStructureNoteRow.spec.js.snap +33 -29
  29. package/src/components/__tests__/__snapshots__/StructureTag.spec.js.snap +13 -2
  30. package/src/components/__tests__/__snapshots__/StructureTagForm.spec.js.snap +7 -56
  31. package/src/components/__tests__/__snapshots__/StructureTags.spec.js.snap +32 -44
  32. package/src/components/__tests__/__snapshots__/StructureTagsCards.spec.js.snap +53 -118
  33. package/src/components/__tests__/__snapshots__/StructureTagsCrumbs.spec.js.snap +1 -1
  34. package/src/components/__tests__/__snapshots__/StructureTypes.spec.js.snap +1 -1
  35. package/src/components/__tests__/__snapshots__/StructureTypesCrumbs.spec.js.snap +1 -1
  36. package/src/components/__tests__/__snapshots__/StructureTypesTable.spec.js.snap +2 -2
  37. package/src/messages/en.js +4 -2
  38. package/src/messages/es.js +8 -4
  39. package/src/reducers/__tests__/editableStructureTags.spec.js +39 -0
  40. package/src/reducers/__tests__/structureTagsSaving.spec.js +40 -0
  41. package/src/reducers/__tests__/structuresUploadEventsLoading.spec.js +18 -4
  42. package/src/reducers/ddMessage.js +8 -9
  43. package/src/reducers/editableStructureTags.js +19 -0
  44. package/src/reducers/index.js +4 -9
  45. package/src/reducers/structureTagSaving.js +18 -0
  46. package/src/routines.js +3 -5
  47. package/src/sagas/__tests__/createStructureTag.spec.js +28 -13
  48. package/src/sagas/__tests__/deleteStructureTag.spec.js +27 -15
  49. package/src/sagas/__tests__/updateStructureTag.spec.js +26 -13
  50. package/src/sagas/createStructureTag.js +15 -13
  51. package/src/sagas/deleteStructureTag.js +13 -8
  52. package/src/sagas/index.js +0 -6
  53. package/src/sagas/updateStructureTag.js +8 -15
  54. package/src/selectors/__tests__/getStructuresUploadEventColumns.spec.js +1 -1
  55. package/src/components/StructureTagLoader.js +0 -28
  56. package/src/components/StructureTagsLoader.js +0 -26
  57. package/src/components/__tests__/StructureTagLoader.spec.js +0 -29
  58. package/src/components/__tests__/StructureTagsLoader.spec.js +0 -24
  59. package/src/components/__tests__/__snapshots__/StructureTagLoader.spec.js.snap +0 -3
  60. package/src/components/__tests__/__snapshots__/StructureTagsLoader.spec.js.snap +0 -3
  61. package/src/reducers/__tests__/structureTag.spec.js +0 -80
  62. package/src/reducers/__tests__/structureTagLoading.spec.js +0 -40
  63. package/src/reducers/__tests__/structureTags.spec.js +0 -32
  64. package/src/reducers/__tests__/structureTagsLoading.spec.js +0 -40
  65. package/src/reducers/structureTag.js +0 -38
  66. package/src/reducers/structureTagLoading.js +0 -16
  67. package/src/reducers/structureTags.js +0 -19
  68. package/src/reducers/structureTagsLoading.js +0 -16
  69. package/src/sagas/__tests__/deleteStructureType.spec.js +0 -70
  70. package/src/sagas/__tests__/fetchStructureTag.spec.js +0 -74
  71. package/src/sagas/__tests__/fetchStructureTags.spec.js +0 -72
  72. package/src/sagas/fetchStructureTag.js +0 -29
  73. package/src/sagas/fetchStructureTags.js +0 -25
@@ -16,7 +16,7 @@ export const StructureTagsCrumbs = ({ structureTag, action }) => {
16
16
  <Breadcrumb.Section as={Link} to={STRUCTURE_TAGS} active={false}>
17
17
  <FormattedMessage id="structureTags.crumbs.root" />
18
18
  </Breadcrumb.Section>
19
- {!_.isEmpty(structureTag) && (
19
+ {_.isEmpty(structureTag) ? null : (
20
20
  <>
21
21
  <Breadcrumb.Divider icon="right angle" />
22
22
  <Breadcrumb.Section {...rootBreadcrumb}>
@@ -24,21 +24,21 @@ export const StructureTagsCrumbs = ({ structureTag, action }) => {
24
24
  </Breadcrumb.Section>
25
25
  </>
26
26
  )}
27
- {action && (
27
+ {action ? (
28
28
  <>
29
29
  <Breadcrumb.Divider icon="right angle" />
30
30
  <Breadcrumb.Section active>
31
31
  <FormattedMessage id={action} />
32
32
  </Breadcrumb.Section>
33
33
  </>
34
- )}
34
+ ) : null}
35
35
  </Breadcrumb>
36
36
  );
37
37
  };
38
38
 
39
39
  StructureTagsCrumbs.propTypes = {
40
40
  structureTag: PropTypes.object,
41
- action: PropTypes.string
41
+ action: PropTypes.string,
42
42
  };
43
43
 
44
44
  export default StructureTagsCrumbs;
@@ -1,70 +1,46 @@
1
1
  import _ from "lodash/fp";
2
2
  import React from "react";
3
- import PropTypes from "prop-types";
4
- import { connect } from "react-redux";
5
- import { Route, Switch } from "react-router-dom";
3
+ import { Route, Switch, useParams } from "react-router-dom";
4
+ import { useQuery } from "@apollo/client";
5
+ import { Unauthorized } from "@truedat/core/components";
6
+ import { useAuthorized } from "@truedat/core/hooks";
6
7
  import {
7
8
  STRUCTURE_TAGS,
8
9
  STRUCTURE_TAGS_EDIT,
9
- STRUCTURE_TAGS_NEW
10
+ STRUCTURE_TAGS_NEW,
10
11
  } from "@truedat/core/routes";
11
- import StructureTagsCrumbs from "./StructureTagsCrumbs";
12
- import StructureTagLoader from "./StructureTagLoader";
13
- import StructureTags from "./StructureTags";
14
- import StructureTagsLoader from "./StructureTagsLoader";
12
+ import { STRUCTURE_TAG_QUERY } from "../api/queries";
15
13
  import StructureTag from "./StructureTag";
14
+ import StructureTags from "./StructureTags";
16
15
 
17
- export const StructureTagsRoutes = ({
18
- structureTagLoading,
19
- structureTagsLoading
20
- }) => {
21
- return (
22
- <Switch>
23
- <Route
24
- path={STRUCTURE_TAGS}
25
- exact
26
- render={() => (
27
- <>
28
- <StructureTagsLoader />
29
- {!structureTagsLoading && <StructureTags />}
30
- </>
31
- )}
32
- />
16
+ export const StructureTagLoader = () => {
17
+ const { id } = useParams();
18
+ const { loading, error, data } = useQuery(STRUCTURE_TAG_QUERY, {
19
+ variables: { id },
20
+ });
21
+ if (error) return null;
22
+ const structureTag = data?.structureTag;
23
+ return <StructureTag id={id} structureTag={structureTag} loading={loading} />;
24
+ };
33
25
 
34
- <Route
35
- path={STRUCTURE_TAGS_NEW}
36
- exact
37
- render={() => (
38
- <>
39
- <StructureTagsCrumbs action="structureTags.actions.create" />
40
- <StructureTag isCreate />
41
- </>
42
- )}
43
- />
26
+ export const AuthorizedStructureTagsRoutes = () => (
27
+ <Switch>
28
+ <Route exact path={STRUCTURE_TAGS_NEW} render={() => <StructureTag />} />
29
+ <Route exact path={STRUCTURE_TAGS} render={() => <StructureTags />} />
30
+ <Route path={STRUCTURE_TAGS_EDIT} render={() => <StructureTagLoader />} />
31
+ </Switch>
32
+ );
44
33
 
45
- <Route
46
- path={STRUCTURE_TAGS_EDIT}
47
- exact
48
- render={() => (
49
- <>
50
- <StructureTagLoader />
51
- <StructureTagsCrumbs action="structureTags.actions.edit" />
52
- {!structureTagLoading && <StructureTag />}
53
- </>
54
- )}
55
- />
56
- </Switch>
34
+ export const StructureTagsRoutes = () => {
35
+ const authorized = useAuthorized();
36
+ return (
37
+ <Route
38
+ path={STRUCTURE_TAGS}
39
+ render={() =>
40
+ authorized ? <AuthorizedStructureTagsRoutes /> : <Unauthorized />
41
+ }
42
+ />
57
43
  );
58
44
  };
59
45
 
60
- StructureTagsRoutes.propTypes = {
61
- structureTagLoading: PropTypes.bool,
62
- structureTagsLoading: PropTypes.bool
63
- };
64
-
65
- const mapStateToProps = ({ structureTagLoading, structureTagsLoading }) => ({
66
- structureTagLoading,
67
- structureTagsLoading
68
- });
69
-
70
- export default connect(mapStateToProps)(StructureTagsRoutes);
46
+ export default StructureTagsRoutes;
@@ -15,7 +15,6 @@ import DomainsLoader from "@truedat/bg/taxonomy/components/DomainsLoader";
15
15
  import StructureCrumbs from "./StructureCrumbs";
16
16
  import StructureLoader from "./StructureLoader";
17
17
  import UserSearchFiltersLoader from "./UserSearchFiltersLoader";
18
- import StructureTagsLoader from "./StructureTagsLoader";
19
18
  import StructureView from "./StructureView";
20
19
  import StructuresBulkUpdate from "./StructuresBulkUpdate";
21
20
  import StructuresView from "./StructuresView";
@@ -93,7 +92,6 @@ const AuthorizedRoutes = () => {
93
92
  path={STRUCTURE_VERSION}
94
93
  render={() => (
95
94
  <>
96
- <StructureTagsLoader />
97
95
  <StructureLoader />
98
96
  <StructureImplementationsLoader />
99
97
  </>
@@ -103,7 +101,6 @@ const AuthorizedRoutes = () => {
103
101
  path={STRUCTURE}
104
102
  render={() => (
105
103
  <>
106
- <StructureTagsLoader />
107
104
  <StructureLoader />
108
105
  <StructureImplementationsLoader />
109
106
  </>
@@ -5,35 +5,28 @@ import PropTypes from "prop-types";
5
5
  import LinkedStructureTag from "./LinkedStructureTag";
6
6
  import StructureLinkTagButton from "./StructureLinkTagButton";
7
7
 
8
- export const TagsHeader = ({
9
- linkedStructureTags,
10
- manageTags,
11
- structureTags,
12
- }) => (
8
+ export const TagsHeader = ({ linkedStructureTags, editable }) => (
13
9
  <>
14
- {_.negate(_.isEmpty)(linkedStructureTags) &&
15
- _.flow(
16
- _.sortBy("inserted_at"),
17
- _.map.convert({ cap: false })((link, i) => (
18
- <LinkedStructureTag key={i} {...link} />
19
- ))
20
- )(linkedStructureTags)}
21
- {_.negate(_.isEmpty)(structureTags) && manageTags && (
22
- <StructureLinkTagButton />
23
- )}
10
+ {_.isEmpty(linkedStructureTags)
11
+ ? null
12
+ : _.flow(
13
+ _.sortBy("inserted_at"),
14
+ _.map.convert({ cap: false })((link, i) => (
15
+ <LinkedStructureTag key={i} editable={editable} {...link} />
16
+ ))
17
+ )(linkedStructureTags)}
18
+ <StructureLinkTagButton />
24
19
  </>
25
20
  );
26
21
 
27
22
  TagsHeader.propTypes = {
23
+ editable: PropTypes.bool,
28
24
  linkedStructureTags: PropTypes.array,
29
- manageTags: PropTypes.bool,
30
- structureTags: PropTypes.array,
31
25
  };
32
26
 
33
- const mapStateToProps = (state) => ({
34
- linkedStructureTags: state.linkedStructureTags,
35
- manageTags: state.userPermissions.manage_tags,
36
- structureTags: state.structureTags,
27
+ const mapStateToProps = ({ linkedStructureTags, editableStructureTags }) => ({
28
+ linkedStructureTags,
29
+ editable: !!editableStructureTags,
37
30
  });
38
31
 
39
32
  export default connect(mapStateToProps)(TagsHeader);
@@ -36,7 +36,11 @@ const props = {
36
36
  describe("<PendingStructureNoteRow />", () => {
37
37
  it("matches the latest snapshot", async () => {
38
38
  const { container, queryByText } = render(
39
- <PendingStructureNoteRow {...props} />,
39
+ <table>
40
+ <tbody>
41
+ <PendingStructureNoteRow {...props} />
42
+ </tbody>
43
+ </table>,
40
44
  renderOpts
41
45
  );
42
46
  expect(container).toMatchSnapshot();
@@ -70,13 +70,13 @@ const structureNotes = {
70
70
  ],
71
71
  };
72
72
 
73
- const StructureNotesMock = {
73
+ const structureNotesMock = {
74
74
  request: { query: STRUCTURE_NOTES },
75
75
  result: { data: { structureNotes } },
76
76
  };
77
77
 
78
78
  const renderOpts = {
79
- mocks: [StructureNotesMock],
79
+ mocks: [structureNotesMock],
80
80
  messages,
81
81
  state: { domains },
82
82
  };
@@ -4,7 +4,10 @@ import { StructureTag } from "../StructureTag";
4
4
 
5
5
  describe("<StructureTag />", () => {
6
6
  it("matches the latest snapshot", () => {
7
- const wrapper = shallow(<StructureTag />);
7
+ const createStructureTag = jest.fn();
8
+ const wrapper = shallow(
9
+ <StructureTag createStructureTag={createStructureTag} />
10
+ );
8
11
  expect(wrapper).toMatchSnapshot();
9
12
  });
10
13
  });
@@ -1,111 +1,69 @@
1
1
  import React from "react";
2
- import { MemoryRouter } from "react-router-dom";
3
- import { intl } from "@truedat/test/intl-stub";
4
- import { render, waitFor } from "@testing-library/react";
2
+ import { waitFor } from "@testing-library/react";
5
3
  import userEvent from "@testing-library/user-event";
6
- import { StructureTagForm } from "../StructureTagForm";
7
-
8
- // workaround for enzyme issue with React.useContext
9
- // see https://github.com/airbnb/enzyme/issues/2176#issuecomment-532361526
10
- jest.spyOn(React, "useContext").mockImplementation(() => intl);
4
+ import { render } from "@truedat/test/render";
5
+ import { DOMAINS_QUERY } from "@truedat/core/api/queries";
6
+ import coreEn from "@truedat/core/messages/en";
7
+ import StructureTagForm from "../StructureTagForm";
8
+ import en from "../../messages/en";
9
+
10
+ const domainsMock = {
11
+ request: { query: DOMAINS_QUERY },
12
+ result: { data: { domains: [{ id: "123", name: "foo" }] } },
13
+ };
14
+ const renderOpts = {
15
+ messages: { en: { ...coreEn, ...en } },
16
+ mocks: [domainsMock],
17
+ };
11
18
 
12
19
  describe("<StructureTagForm />", () => {
13
- const createStructureTag = jest.fn();
14
- const updateStructureTag = jest.fn();
20
+ const onSubmit = jest.fn();
15
21
  const structureTag = {
16
22
  id: 1,
17
- name: "tag1"
18
- };
19
- const isSubmitting = false;
20
- const propsCreate = {
21
- createStructureTag,
22
- updateStructureTag,
23
- structureTag: {},
24
- isSubmitting
23
+ name: "foo",
24
+ domainIds: [],
25
25
  };
26
- const propsUpdate = {
27
- createStructureTag,
28
- updateStructureTag,
26
+ const saving = false;
27
+ const props = {
28
+ onSubmit,
29
29
  structureTag,
30
- isSubmitting
30
+ saving,
31
31
  };
32
32
 
33
- it("matches the latest snapshot create", async () => {
34
- const { container, findByRole } = render(
35
- <MemoryRouter>
36
- <StructureTagForm {...propsCreate} />
37
- </MemoryRouter>
38
- );
39
- await findByRole("button", { name: /submit/ });
40
- expect(container).toMatchSnapshot();
41
- });
42
-
43
- it("matches the latest snapshot edit", async () => {
33
+ it("matches the latest snapshot", async () => {
44
34
  const { container, findByRole } = render(
45
- <MemoryRouter>
46
- <StructureTagForm {...propsUpdate} />
47
- </MemoryRouter>
35
+ <StructureTagForm {...props} />,
36
+ renderOpts
48
37
  );
49
- await findByRole("button", { name: /submit/ });
38
+ await findByRole("button", { name: /save/i });
50
39
  expect(container).toMatchSnapshot();
51
40
  });
52
41
 
53
- it("calls createStructureTag with data on submit", async () => {
54
- const { findByRole, getByRole } = render(
55
- <MemoryRouter>
56
- <StructureTagForm {...propsCreate} />
57
- </MemoryRouter>
58
- );
42
+ it("calls onSubmit with data on submit", async () => {
43
+ const { getByRole } = render(<StructureTagForm {...props} />, renderOpts);
59
44
 
60
45
  // Submit button should initially be disabled
61
46
  await waitFor(() =>
62
- expect(getByRole("button", { name: /submit/ })).toBeDisabled()
47
+ expect(getByRole("button", { name: /save/i })).toBeDisabled()
63
48
  );
64
49
 
65
50
  // Description
66
- userEvent.type(await findByRole("textbox", { name: /name/ }), "foo");
51
+ userEvent.type(getByRole("textbox", { name: /name/i }), "foo");
67
52
 
68
53
  // Submit button should now be enabled
69
54
  await waitFor(() =>
70
- expect(getByRole("button", { name: /submit/ })).not.toBeDisabled()
55
+ expect(getByRole("button", { name: /save/i })).not.toBeDisabled()
71
56
  );
72
57
 
73
58
  // Submit
74
- userEvent.click(await findByRole("button", { name: /submit/ }));
75
-
76
- await waitFor(() =>
77
- expect(createStructureTag).toHaveBeenCalledWith({ name: "foo" })
78
- );
79
- });
80
-
81
- it("calls updateStructureTag if is updating with data on submit", async () => {
82
- const { findByRole, getByRole } = render(
83
- <MemoryRouter>
84
- <StructureTagForm {...propsUpdate} />
85
- </MemoryRouter>
86
- );
87
-
88
- // Submit button should initially be disabled
89
- await waitFor(() =>
90
- expect(getByRole("button", { name: /submit/ })).toBeDisabled()
91
- );
92
-
93
- // Description
94
- userEvent.type(await findByRole("textbox", { name: /name/ }), " updated");
95
-
96
- // Submit button should now be enabled
97
- await waitFor(() =>
98
- expect(getByRole("button", { name: /submit/ })).not.toBeDisabled()
99
- );
100
-
101
- // Submit
102
- userEvent.click(await findByRole("button", { name: /submit/ }));
103
-
104
- await waitFor(() =>
105
- expect(updateStructureTag).toHaveBeenCalledWith({
106
- id: 1,
107
- name: "tag1 updated"
108
- })
109
- );
59
+ userEvent.click(getByRole("button", { name: /save/i }));
60
+
61
+ await waitFor(() => {
62
+ expect(onSubmit.mock.calls.length).toBe(1);
63
+ });
64
+ expect(onSubmit.mock.calls[0][0]).toMatchObject({
65
+ name: "foofoo",
66
+ domainIds: [],
67
+ });
110
68
  });
111
69
  });
@@ -1,14 +1,14 @@
1
1
  import React from "react";
2
- import { shallow } from "enzyme";
3
- import { StructureTags } from "../StructureTags";
2
+ import { render } from "@truedat/test/render";
3
+ import StructureTags from "../StructureTags";
4
+ import en from "../../messages/en";
4
5
 
5
- jest.mock("@truedat/core/hooks", () => ({
6
- useAuthorized: jest.fn(() => true)
7
- }));
6
+ const messages = { en };
7
+ const renderOpts = { messages };
8
8
 
9
9
  describe("<StructureTags />", () => {
10
10
  it("matches the latest snapshot", () => {
11
- const wrapper = shallow(<StructureTags />);
12
- expect(wrapper).toMatchSnapshot();
11
+ const { container } = render(<StructureTags />, renderOpts);
12
+ expect(container).toMatchSnapshot();
13
13
  });
14
14
  });
@@ -1,42 +1,44 @@
1
1
  import React from "react";
2
- import { shallow } from "enzyme";
3
- import { StructureTagsCards } from "../StructureTagsCards";
2
+ import { waitFor } from "@testing-library/react";
3
+ import { render } from "@truedat/test/render";
4
+ import { STRUCTURE_TAGS_QUERY } from "../../api/queries";
5
+ import StructureTagsCards from "../StructureTagsCards";
6
+ import en from "../../messages/en";
4
7
 
5
- describe("<StructureTagsCards />", () => {
6
- const deleteStructureTag = jest.fn();
7
- const structureTags = [
8
- { id: 1, name: "tag1", structure_count: 0 },
9
- { id: 2, name: "tag2", structure_count: 5 }
10
- ];
11
- const structureTagsLoading = false;
8
+ const structureTagsMock = {
9
+ request: { query: STRUCTURE_TAGS_QUERY },
10
+ result: {
11
+ data: {
12
+ structureTags: [
13
+ {
14
+ __typename: "StructureTag",
15
+ id: "1",
16
+ name: "tag1",
17
+ domainIds: [],
18
+ structureCount: 1,
19
+ },
20
+ {
21
+ __typename: "StructureTag",
22
+ id: "2",
23
+ name: "tag2",
24
+ domainIds: ["1"],
25
+ structureCount: 1,
26
+ },
27
+ ],
28
+ },
29
+ },
30
+ };
31
+ const messages = { en };
12
32
 
13
- it("matches the latest snapshot", () => {
14
- const props = {
15
- deleteStructureTag,
16
- structureTags,
17
- structureTagsLoading
18
- };
19
- const wrapper = shallow(<StructureTagsCards {...props} />);
20
- expect(wrapper).toMatchSnapshot();
21
- });
33
+ const renderOpts = { mocks: [structureTagsMock], messages };
22
34
 
23
- it("matches the latest snapshot for empty", () => {
24
- const props = {
25
- deleteStructureTag,
26
- structureTags: [],
27
- structureTagsLoading
28
- };
29
- const wrapper = shallow(<StructureTagsCards {...props} />);
30
- expect(wrapper).toMatchSnapshot();
31
- });
32
-
33
- it("renders one card per structure tag", () => {
34
- const props = {
35
- deleteStructureTag,
36
- structureTags,
37
- structureTagsLoading
38
- };
39
- const wrapper = shallow(<StructureTagsCards {...props} />);
40
- expect(wrapper.find("Card")).toHaveLength(2);
35
+ describe("<StructureTagsCards />", () => {
36
+ it("matches the latest snapshot, renders a link for each tag", async () => {
37
+ const { container, getByRole } = render(<StructureTagsCards />, renderOpts);
38
+ await waitFor(() => {
39
+ expect(getByRole("link", { name: /tag1/i })).toBeInTheDocument();
40
+ expect(getByRole("link", { name: /tag2/i })).toBeInTheDocument();
41
+ });
42
+ expect(container).toMatchSnapshot();
41
43
  });
42
44
  });
@@ -5,56 +5,53 @@ import { render } from "@truedat/test/render";
5
5
  import en from "../../messages/en";
6
6
  import StructuresUploadEventsTable from "../StructuresUploadEventsTable";
7
7
 
8
-
9
-
10
8
  const events = [
11
9
  {
12
- "csv_hash": "99E400B91D164F8F0A39F400CA323C8F",
13
- "inserted_at": "2022-04-23T15:53:24.638484Z",
14
- "message": null,
15
- "response": {
16
- "errors": [],
17
- "ids": [
18
- 4825521,
19
- 4825561,
20
- 4825593
21
- ]
10
+ csv_hash: "99E400B91D164F8F0A39F400CA323C8F",
11
+ inserted_at: "2022-04-23T15:53:24.638484Z",
12
+ message: null,
13
+ response: {
14
+ errors: [],
15
+ ids: [4825521, 4825561, 4825593],
22
16
  },
23
- "status": "COMPLETED",
24
- "task_reference": "0.3225053307.1609564164.100549",
25
- "user_id": 467
17
+ status: "COMPLETED",
18
+ task_reference: "0.3225053307.1609564164.100549",
19
+ user_id: 467,
26
20
  },
27
21
  {
28
- "csv_hash": "47D90FDF1AD967BD7DBBDAE28664278E",
29
- "inserted_at": "2022-04-23T15:14:48.770275Z",
30
- "message": null,
31
- "response": {
32
- "errors": [
22
+ csv_hash: "47D90FDF1AD967BD7DBBDAE28664278E",
23
+ inserted_at: "2022-04-23T15:14:48.770275Z",
24
+ message: null,
25
+ response: {
26
+ errors: [
33
27
  {
34
- "external_id": "file://corporate-landing-s3/cep-pro-ld-cor/batch/SAP/FSCM/vendor_issue/SAP_FSCM_CM_VENDOR_ISUE/ZFSCM_AC",
35
- "field": "gdpr",
36
- "message": "df_content.inclusion",
37
- "row": 4
28
+ external_id:
29
+ "file://corporate-landing-s3/cep-pro-ld-cor/batch/SAP/FSCM/vendor_issue/SAP_FSCM_CM_VENDOR_ISUE/ZFSCM_AC",
30
+ field: "gdpr",
31
+ message: "df_content.inclusion",
32
+ row: 4,
38
33
  },
39
34
  {
40
- "external_id": "file://corporate-landing-s3/cep-pro-ld-cor/batch/SAP/FSCM/vendor_issue/SAP_FSCM_CM_VENDOR_ISUE/ZFSCM_FN",
41
- "field": "business_description",
42
- "message": "df_content.required",
43
- "row": 2
35
+ external_id:
36
+ "file://corporate-landing-s3/cep-pro-ld-cor/batch/SAP/FSCM/vendor_issue/SAP_FSCM_CM_VENDOR_ISUE/ZFSCM_FN",
37
+ field: "business_description",
38
+ message: "df_content.required",
39
+ row: 2,
44
40
  },
45
41
  {
46
- "external_id": "file://corporate-landing-s3/cep-pro-ld-cor/batch/SAP/FSCM/vendor_issue/SAP_FSCM_CM_VENDOR_ISUE/ZFSCM_PC",
47
- "field": "business_description",
48
- "message": "df_content.required",
49
- "row": 3
50
- }
42
+ external_id:
43
+ "file://corporate-landing-s3/cep-pro-ld-cor/batch/SAP/FSCM/vendor_issue/SAP_FSCM_CM_VENDOR_ISUE/ZFSCM_PC",
44
+ field: "business_description",
45
+ message: "df_content.required",
46
+ row: 3,
47
+ },
51
48
  ],
52
- "ids": []
49
+ ids: [],
53
50
  },
54
- "status": "COMPLETED",
55
- "task_reference": "0.3225053307.1609564162.101463",
56
- "user_id": 467
57
- }
51
+ status: "COMPLETED",
52
+ task_reference: "0.3225053307.1609564162.101463",
53
+ user_id: 467,
54
+ },
58
55
  ];
59
56
 
60
57
  const renderOpts = {
@@ -62,7 +59,6 @@ const renderOpts = {
62
59
  state: { structuresUploadEvents: events },
63
60
  };
64
61
 
65
-
66
62
  describe("<StructuresUploadEventsTable />", () => {
67
63
  it("matches the latest snapshot", () => {
68
64
  const { container } = render(<StructuresUploadEventsTable />, renderOpts);
@@ -79,6 +75,4 @@ describe("<StructuresUploadEventsTable />", () => {
79
75
  userEvent.click(dataRow);
80
76
  expect(dataRow).toHaveClass("expanded");
81
77
  });
82
-
83
-
84
- });
78
+ });
@@ -14,11 +14,11 @@ exports[`<DictionaryRoutes /> matches the latest snapshot 1`] = `
14
14
  render={[Function]}
15
15
  />
16
16
  <Route
17
- path="/structure_tags"
17
+ path="/structureTags"
18
18
  render={[Function]}
19
19
  />
20
20
  <Route
21
- path="/structure_types"
21
+ path="/structureTypes"
22
22
  render={[Function]}
23
23
  />
24
24
  <Route
@@ -26,7 +26,7 @@ exports[`<DictionaryRoutes /> matches the latest snapshot 1`] = `
26
26
  render={[Function]}
27
27
  />
28
28
  <Route
29
- path="/structure_notes"
29
+ path="/structureNotes"
30
30
  render={[Function]}
31
31
  />
32
32
  <Route