@truedat/test 4.47.8 → 4.51.3

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 CHANGED
@@ -1,10 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.51.3] 2022-09-16
4
+
5
+ ### Added
6
+
7
+ - [TD-4794] `domainsMock` for mocking GraphQL domains query
8
+
3
9
  ## [4.45.8] 2022-06-09
4
10
 
5
11
  ### Added
6
12
 
7
- - [TD-4431] `render` now can receive `dispatch` option that will be replaced on store to test dispatched action calls
13
+ - [TD-4431] `render` now can receive `dispatch` option that will be replaced on
14
+ store to test dispatched action calls
8
15
 
9
16
  ## [4.44.3] 2022-05-11
10
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/test",
3
- "version": "4.47.8",
3
+ "version": "4.51.3",
4
4
  "description": "Truedat Web Test",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -99,5 +99,5 @@
99
99
  "react": ">= 16.8.6 < 17",
100
100
  "react-dom": ">= 16.8.6 < 17"
101
101
  },
102
- "gitHead": "dccc0d92c419a5ee257a8e15b64c1b98d909809a"
102
+ "gitHead": "69d6cf8f7379eb2ef5744a4fdd357a7dd662b115"
103
103
  }
package/src/mocks.js CHANGED
@@ -1,4 +1,4 @@
1
- import { TEMPLATES_QUERY } from "@truedat/core/api/queries";
1
+ import { DOMAINS_QUERY, TEMPLATES_QUERY } from "@truedat/core/api/queries";
2
2
 
3
3
  const template1 = {
4
4
  __typename: "Template",
@@ -37,3 +37,48 @@ export const errorTemplateMock = (variables) => ({
37
37
  request: { query: TEMPLATES_QUERY, variables },
38
38
  error: new Error("Error fetching templates"),
39
39
  });
40
+
41
+ export const domainsMock = (variables) => ({
42
+ request: {
43
+ query: DOMAINS_QUERY,
44
+ variables,
45
+ },
46
+ result: {
47
+ data: {
48
+ domains: [
49
+ {
50
+ __typename: "Domain",
51
+ name: "fooDomain",
52
+ id: "1",
53
+ externalId: "foo",
54
+ parentId: null,
55
+ actions: null,
56
+ },
57
+ {
58
+ __typename: "Domain",
59
+ name: "barDomain",
60
+ id: "2",
61
+ externalId: "bar",
62
+ parentId: null,
63
+ actions: null,
64
+ },
65
+ {
66
+ __typename: "Domain",
67
+ name: "bazDomain",
68
+ id: "3",
69
+ externalId: "baz",
70
+ parentId: null,
71
+ actions: null,
72
+ },
73
+ {
74
+ __typename: "Domain",
75
+ name: "xyzzy",
76
+ id: "33",
77
+ externalId: "d1",
78
+ parentId: "2",
79
+ actions: null,
80
+ },
81
+ ],
82
+ },
83
+ },
84
+ });