Skip to content

Commit b159a9b

Browse files
committed
Revert some changes from migration challenge - create.spec.js
1 parent 1d0a54a commit b159a9b

File tree

1 file changed

+89
-1
lines changed

1 file changed

+89
-1
lines changed

src/routes/projects/create.spec.js

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,95 @@ describe('Project create', () => {
1616
before((done) => {
1717
sinon.stub(RabbitMQService.prototype, 'init', () => {});
1818
sinon.stub(RabbitMQService.prototype, 'publish', () => {});
19-
testUtil.clearDb(done);
19+
testUtil.clearDb()
20+
.then(() => models.ProjectType.bulkCreate([
21+
{
22+
key: 'generic',
23+
displayName: 'Generic',
24+
createdBy: 1,
25+
updatedBy: 1,
26+
},
27+
]))
28+
.then(() => models.ProjectTemplate.bulkCreate([
29+
{
30+
id: 1,
31+
name: 'template 1',
32+
key: 'key 1',
33+
category: 'category 1',
34+
icon: 'http://example.com/icon1.ico',
35+
question: 'question 1',
36+
info: 'info 1',
37+
aliases: [],
38+
scope: {},
39+
phases: {
40+
phase1: {
41+
name: 'phase 1',
42+
products: [
43+
{
44+
id: 21,
45+
name: 'product 1',
46+
productKey: 'visual_design_prod1',
47+
},
48+
{
49+
id: 22,
50+
name: 'product 2',
51+
productKey: 'visual_design_prod2',
52+
},
53+
],
54+
},
55+
},
56+
createdBy: 1,
57+
updatedBy: 1,
58+
},
59+
{
60+
id: 3,
61+
name: 'template 3',
62+
key: 'key 3',
63+
category: 'category 3',
64+
icon: 'http://example.com/icon3.ico',
65+
question: 'question 3',
66+
info: 'info 3',
67+
aliases: [],
68+
scope: {},
69+
phases: {
70+
1: {
71+
name: 'Design Stage',
72+
status: 'open',
73+
details: {
74+
description: 'detailed description',
75+
},
76+
products: [
77+
{
78+
id: 21,
79+
name: 'product 1',
80+
productKey: 'visual_design_prod',
81+
},
82+
],
83+
},
84+
2: {
85+
name: 'Development Stage',
86+
status: 'open',
87+
products: [
88+
{
89+
id: 23,
90+
name: 'product 2',
91+
details: {
92+
subDetails: 'subDetails 2',
93+
},
94+
productKey: 'website_development',
95+
},
96+
],
97+
},
98+
3: {
99+
name: 'QA Stage',
100+
status: 'open',
101+
},
102+
},
103+
createdBy: 1,
104+
updatedBy: 2,
105+
},
106+
]))
107+
.then(() => done());
20108
});
21109

22110
after((done) => {

0 commit comments

Comments
 (0)