@projectcaluma/ember-testing 11.0.0-beta.25 → 11.0.0-beta.28
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.
|
@@ -191,7 +191,12 @@ export default class BaseMock {
|
|
|
191
191
|
_,
|
|
192
192
|
{ input: { clientMutationId = faker.datatype.uuid(), slug, id, ...args } }
|
|
193
193
|
) {
|
|
194
|
-
|
|
194
|
+
// Sometimes we pass the identifier as property `slug` (e.g in `saveForm`),
|
|
195
|
+
// sometimes as `id` (e.g. in `saveDocument`) and sometimes as the camelized
|
|
196
|
+
// name of the type (e.g in `saveWorkItem`).
|
|
197
|
+
const identifier = slug
|
|
198
|
+
? { slug }
|
|
199
|
+
: { id: id ?? args[camelize(this.type)] };
|
|
195
200
|
|
|
196
201
|
const relKeys = this.schema.modelFor(camelize(this.type)).foreignKeys;
|
|
197
202
|
|
|
@@ -31,16 +31,21 @@ export default class WorkItemMock extends BaseMock {
|
|
|
31
31
|
handleRedoWorkItem(_, { input }) {
|
|
32
32
|
const { id } = deserialize(input);
|
|
33
33
|
const workItem = this.collection.find(id);
|
|
34
|
+
const caseId = workItem?.childCaseId;
|
|
34
35
|
|
|
35
36
|
if (workItem.taskId === "distribution") {
|
|
36
|
-
const caseId = workItem.childCaseId;
|
|
37
|
-
|
|
38
37
|
this.collection
|
|
39
38
|
.where({ caseId, taskId: "complete-distribution" })
|
|
40
39
|
.update({ status: "READY" });
|
|
41
40
|
this.collection
|
|
42
41
|
.where({ caseId, taskId: "create-inquiry" })
|
|
43
42
|
.update({ status: "READY" });
|
|
43
|
+
} else if (workItem.taskId === "inquiry") {
|
|
44
|
+
this.server.create("work-item", {
|
|
45
|
+
caseId,
|
|
46
|
+
status: "READY",
|
|
47
|
+
taskId: "adjust-inquiry-answer",
|
|
48
|
+
});
|
|
44
49
|
}
|
|
45
50
|
|
|
46
51
|
return this.handleSavePayload.fn.call(this, _, {
|
|
@@ -81,7 +86,7 @@ export default class WorkItemMock extends BaseMock {
|
|
|
81
86
|
.update({ status: "CANCELED" });
|
|
82
87
|
this.collection
|
|
83
88
|
.findBy({ childCaseId: caseId })
|
|
84
|
-
.update({ status: "COMPLETED" });
|
|
89
|
+
.update({ status: "COMPLETED", isRedoable: true });
|
|
85
90
|
this.schema.cases.find(caseId).update({ status: "COMPLETED" });
|
|
86
91
|
} else if (taskId === "revise-inquiry-answer") {
|
|
87
92
|
this.collection
|
|
@@ -193,7 +193,7 @@ export function answerInquiry(server, { inquiry, status, reason, hint }) {
|
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
export function confirmInquiry({ inquiry }) {
|
|
196
|
-
inquiry.update({ status: "COMPLETED" });
|
|
196
|
+
inquiry.update({ status: "COMPLETED", isRedoable: true });
|
|
197
197
|
inquiry.childCase.update({
|
|
198
198
|
status: "COMPLETED",
|
|
199
199
|
closedAt: faker.date.recent(),
|
|
@@ -289,7 +289,7 @@ export default function (server, groups) {
|
|
|
289
289
|
to: g2,
|
|
290
290
|
deadline: faker.date.past(),
|
|
291
291
|
},
|
|
292
|
-
{ id: "6bbdc36a-3174-4578-93d4-0cb84d3dab97" }
|
|
292
|
+
{ id: "6bbdc36a-3174-4578-93d4-0cb84d3dab97", meta: {} }
|
|
293
293
|
),
|
|
294
294
|
});
|
|
295
295
|
confirm({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@projectcaluma/ember-testing",
|
|
3
|
-
"version": "11.0.0-beta.
|
|
3
|
+
"version": "11.0.0-beta.28",
|
|
4
4
|
"description": "Ember addon for testing with Caluma addons.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -15,20 +15,20 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@ember/string": "^3.0.0",
|
|
18
|
-
"@faker-js/faker": "^7.
|
|
18
|
+
"@faker-js/faker": "^7.5.0",
|
|
19
19
|
"broccoli-funnel": "^3.0.8",
|
|
20
20
|
"broccoli-merge-trees": "^4.2.0",
|
|
21
21
|
"ember-apollo-client": "~4.0.2",
|
|
22
22
|
"ember-auto-import": "^2.4.2",
|
|
23
23
|
"ember-cli-babel": "^7.26.11",
|
|
24
|
-
"ember-cli-htmlbars": "^6.1.
|
|
24
|
+
"ember-cli-htmlbars": "^6.1.1",
|
|
25
25
|
"ember-cli-mirage": "^3.0.0-alpha.3",
|
|
26
26
|
"ember-fetch": "^8.1.2",
|
|
27
27
|
"ember-inflector": "^4.0.2",
|
|
28
28
|
"graphql": "^15.8.0",
|
|
29
29
|
"graphql-iso-date": "^3.6.1",
|
|
30
30
|
"graphql-tools": "^4.0.8",
|
|
31
|
-
"luxon": "^3.0.
|
|
31
|
+
"luxon": "^3.0.3",
|
|
32
32
|
"miragejs": "^0.1.45"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|