Skip to content

Commit 271e85f

Browse files
committed
enhance: Update useQuery tests and testing lib
1 parent eb2b7d7 commit 271e85f

6 files changed

Lines changed: 689 additions & 164 deletions

File tree

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2+
3+
exports[`vue useQuery() should retrieve a nested collection 1`] = `
4+
[
5+
Todo {
6+
"completed": false,
7+
"id": "5",
8+
"title": "finish collections",
9+
"userId": "1",
10+
},
11+
]
12+
`;
13+
14+
exports[`vue useQuery() should select Collections 1`] = `
15+
[
16+
Article {
17+
"author": User {
18+
"email": "bob@bob.com",
19+
"id": 23,
20+
"isAdmin": false,
21+
"username": "charles",
22+
},
23+
"content": "whatever",
24+
"id": 5,
25+
"tags": [
26+
"a",
27+
"best",
28+
"react",
29+
],
30+
"title": "hi ho",
31+
},
32+
Article {
33+
"author": User {
34+
"email": "bob@bob.com",
35+
"id": 23,
36+
"isAdmin": false,
37+
"username": "charles",
38+
},
39+
"content": "whatever",
40+
"id": 3,
41+
"tags": [],
42+
"title": "the next time",
43+
},
44+
]
45+
`;
46+
47+
exports[`vue useQuery() should work with unions 1`] = `
48+
[
49+
[
50+
"Schema attribute "another" is not expected.
51+
Expected one of: "first", "second"
52+
53+
Value: {
54+
"id": "6",
55+
"body": "hi",
56+
"type": "another"
57+
}",
58+
],
59+
]
60+
`;
61+
62+
exports[`vue useQuery() should work with unions collections 1`] = `
63+
[
64+
[
65+
"Schema attribute "another" is not expected.
66+
Expected one of: "first", "second"
67+
68+
Value: {
69+
"id": "6",
70+
"body": "hi",
71+
"type": "another"
72+
}",
73+
],
74+
[
75+
"Schema attribute undefined is not expected.
76+
Expected one of: "first", "second"
77+
78+
Value: {
79+
"id": "7",
80+
"body": "hi"
81+
}",
82+
],
83+
[
84+
"TypeError: Unable to determine schema for ArraySchema
85+
Value: {
86+
"id": "6",
87+
"body": "hi",
88+
"type": "another"
89+
}.",
90+
],
91+
[
92+
"TypeError: Unable to determine schema for ArraySchema
93+
Value: {
94+
"id": "7",
95+
"body": "hi"
96+
}.",
97+
],
98+
]
99+
`;
100+
101+
exports[`vue useQuery() should work with unions collections 2`] = `
102+
[
103+
null,
104+
FirstUnion {
105+
"body": "hi",
106+
"firstOnlyField": 5,
107+
"id": "5",
108+
"type": "first",
109+
},
110+
{
111+
"body": "hi",
112+
"id": "6",
113+
"type": "another",
114+
},
115+
{
116+
"body": "hi",
117+
"id": "7",
118+
},
119+
SecondUnion {
120+
"body": "hi",
121+
"id": "100",
122+
"secondeOnlyField": 10,
123+
"type": "second",
124+
},
125+
]
126+
`;

0 commit comments

Comments
 (0)