Skip to content

Commit 7480163

Browse files
Fix tests
1 parent c8539df commit 7480163

File tree

1 file changed

+49
-80
lines changed

1 file changed

+49
-80
lines changed

mock-api/app.js

Lines changed: 49 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -44,92 +44,61 @@ app.get('/v4/projects/:projectId', (req, res) => {
4444
let result
4545
if (projectId === '123') {
4646
result = {
47-
id: '6eba42a4-f7f9-4f1e-bf81-a8553ba5372a',
48-
version: 'v4',
49-
result: {
50-
success: false,
51-
status: 404,
52-
content: 'it is not found'
53-
}
47+
message: 'project not found for id 123',
48+
debug: 'Error: project not found for id 8913555\n at /usr/src/app/dist/routes/projects/get.js:159:20\n at Immediate._onImmediate (/usr/src/app/node_modules/async-listener/glue.js:188:31)\nFrom previous event:\n at Immediate.<anonymous> (/usr/src/app/node_modules/async-listener/glue.js:188:31)\n at runCallback (timers.js:781:20)\n at tryOnImmediate (timers.js:743:5)\n at processImmediate [as _immediateCallback] (timers.js:714:5)\nFrom previous event:\n at retrieveProjectFromDB (/usr/src/app/dist/routes/projects/get.js:155:6)\n at /usr/src/app/dist/routes/projects/get.js:197:14\n at propagateAslWrapper (/usr/src/app/node_modules/async-listener/index.js:504:23)\n at /usr/src/app/node_modules/async-listener/glue.js:188:31\n at /usr/src/app/node_modules/async-listener/index.js:541:70\n at /usr/src/app/node_modules/async-listener/glue.js:188:31\n at <anonymous>\n at process._tickDomainCallback (internal/process/next_tick.js:228:7)\n at process.fallback (/usr/src/app/node_modules/async-listener/index.js:565:15)'
5449
}
5550
} else {
5651
result = {
57-
id: '7eba42a4-f7f9-4f1e-bf81-a8553ba5371a',
58-
version: 'v4',
59-
result: {
60-
success: true,
61-
status: 200,
62-
content: {
63-
id: projectId,
64-
directProjectId: null,
65-
billingAccountId: null,
66-
name: 'Alpha',
67-
description: 'And away we go.',
68-
external: null,
69-
bookmarks: null,
70-
estimatedPrice: '0.00',
71-
actualPrice: null,
72-
terms: [],
73-
type: 'app_dev',
74-
status: 'paused',
75-
details: {
76-
fontIds: [],
77-
offlineAccess: null,
78-
deviceIds: ['PHONE'],
79-
offlineAccessComment: null,
80-
orientationIds: ['PORTRAIT'],
81-
iconsetIds: [],
82-
usesPersonalInformation: null,
83-
colorSwatchIds: [],
84-
modelType: 'app-project',
85-
version: null,
86-
securityLevel: null,
87-
features: '[ ]',
88-
apiIntegration: null,
89-
designNotes: null
90-
},
91-
challengeEligibility: null,
92-
cancelReason: null,
93-
templateId: null,
94-
createdAt: '2016-04-27T22:15:04.285Z',
95-
updatedAt: '2016-10-01T17:33:44.000Z',
52+
actualPrice: null,
53+
description: 'New project roles',
54+
lastActivityAt: '2020-03-14T22:40:31.268Z',
55+
billingAccountId: null,
56+
challengeEligibility: [],
57+
type: 'talent-as-a-service',
58+
templateId: 225,
59+
deletedBy: null,
60+
bookmarks: [],
61+
createdAt: '2020-03-11T22:16:01.699Z',
62+
lastActivityUserId: '40158997',
63+
terms: [],
64+
estimatedPrice: null,
65+
members: [
66+
{
67+
createdAt: '2020-03-11T22:16:01.699Z',
68+
role: 'customer',
69+
updatedBy: 88770049,
70+
createdBy: 88770049,
71+
isPrimary: true,
72+
id: 12506,
73+
userId: 88770049,
74+
projectId: projectId,
9675
deletedBy: null,
97-
createdBy: 40141336,
98-
updatedBy: 40152933,
99-
version: 'v2',
100-
lastActivityAt: '2016-10-01T17:33:44.000Z',
101-
lastActivityUserId: '40152933',
102-
members: [{
103-
id: 995,
104-
userId: 40152933,
105-
role: 'manager',
106-
isPrimary: true,
107-
createdAt: '2016-10-01T17:33:32.000Z',
108-
updatedAt: '2016-10-01T17:33:32.000Z',
109-
deletedBy: null,
110-
createdBy: 40152933,
111-
updatedBy: 40152933,
112-
projectId
113-
}, {
114-
id: 998,
115-
userId: 40141336,
116-
role: 'manager',
117-
isPrimary: true,
118-
createdAt: '2016-10-02T17:33:32.000Z',
119-
updatedAt: '2016-10-02T17:33:32.000Z',
120-
deletedBy: null,
121-
createdBy: 40152933,
122-
updatedBy: 40152933,
123-
projectId
124-
}],
125-
attachments: [],
126-
invites: [],
127-
scopeChangeRequests: []
76+
updatedAt: '2020-03-11T22:16:01.731Z'
12877
},
129-
metadata: {
130-
totalCount: 1
78+
{
79+
createdAt: '2020-03-14T22:40:31.117Z',
80+
role: 'customer',
81+
updatedBy: 40158997,
82+
createdBy: 40158997,
83+
isPrimary: false,
84+
id: 12508,
85+
projectId: projectId,
86+
userId: 40158997,
87+
deletedBy: null,
88+
updatedAt: '2020-03-14T22:40:31.117Z'
13189
}
132-
}
90+
],
91+
invites: [],
92+
id: projectId,
93+
directProjectId: 21037,
94+
cancelReason: null,
95+
updatedAt: '2020-03-14T22:40:31.268Z',
96+
updatedBy: -101,
97+
version: 'v3',
98+
external: null,
99+
createdBy: 88770049,
100+
name: 'Roles &amp; Responsibilities',
101+
status: 'in_review'
133102
}
134103
}
135104

0 commit comments

Comments
 (0)