@@ -159,6 +159,7 @@ describe('Project Controller Tests', () => {
159
159
} )
160
160
161
161
afterEach ( async ( ) => {
162
+ console . log ( `${ Date . now ( ) } : Cleaning up test data` )
162
163
await prisma . $transaction ( [
163
164
prisma . user . deleteMany ( ) ,
164
165
prisma . workspace . deleteMany ( )
@@ -1134,12 +1135,12 @@ describe('Project Controller Tests', () => {
1134
1135
user2 ,
1135
1136
project3 . slug ,
1136
1137
{
1137
- name : 'Forked Project'
1138
+ name : 'Forked Project 1 '
1138
1139
}
1139
1140
) ) as Project
1140
1141
1141
1142
expect ( forkedProject ) . toBeDefined ( )
1142
- expect ( forkedProject . name ) . toBe ( 'Forked Project' )
1143
+ expect ( forkedProject . name ) . toBe ( 'Forked Project 1 ' )
1143
1144
expect ( forkedProject . publicKey ) . toBeDefined ( )
1144
1145
expect ( forkedProject . privateKey ) . toBeDefined ( )
1145
1146
expect ( forkedProject . publicKey ) . not . toBe ( project3 . publicKey )
@@ -1155,7 +1156,7 @@ describe('Project Controller Tests', () => {
1155
1156
} )
1156
1157
1157
1158
expect ( forkedProjectFromDB ) . toBeDefined ( )
1158
- expect ( forkedProjectFromDB . name ) . toBe ( 'Forked Project' )
1159
+ expect ( forkedProjectFromDB . name ) . toBe ( 'Forked Project 1 ' )
1159
1160
expect ( forkedProjectFromDB . publicKey ) . toBeDefined ( )
1160
1161
expect ( forkedProjectFromDB . privateKey ) . toBeDefined ( )
1161
1162
expect ( forkedProjectFromDB . publicKey ) . not . toBe ( project3 . publicKey )
@@ -1170,7 +1171,7 @@ describe('Project Controller Tests', () => {
1170
1171
method : 'POST' ,
1171
1172
url : `/project/123/fork` ,
1172
1173
payload : {
1173
- name : 'Forked Project'
1174
+ name : 'Forked Project 2 '
1174
1175
} ,
1175
1176
headers : {
1176
1177
'x-e2e-user-email' : user2 . email
@@ -1185,7 +1186,7 @@ describe('Project Controller Tests', () => {
1185
1186
method : 'POST' ,
1186
1187
url : `/project/${ project2 . slug } /fork` ,
1187
1188
payload : {
1188
- name : 'Forked Project'
1189
+ name : 'Forked Project 3 '
1189
1190
} ,
1190
1191
headers : {
1191
1192
'x-e2e-user-email' : user1 . email
@@ -1200,7 +1201,7 @@ describe('Project Controller Tests', () => {
1200
1201
user2 ,
1201
1202
project3 . slug ,
1202
1203
{
1203
- name : 'Forked Project'
1204
+ name : 'Forked Project 4 '
1204
1205
}
1205
1206
) ) as Project
1206
1207
@@ -1216,7 +1217,7 @@ describe('Project Controller Tests', () => {
1216
1217
user2 ,
1217
1218
project3 . slug ,
1218
1219
{
1219
- name : 'Forked Project' ,
1220
+ name : 'Forked Project 5 ' ,
1220
1221
workspaceSlug : newWorkspace . slug
1221
1222
}
1222
1223
) ) as Project
@@ -1226,7 +1227,7 @@ describe('Project Controller Tests', () => {
1226
1227
1227
1228
it ( 'should not be able to create a fork with the same name in a workspace' , async ( ) => {
1228
1229
await projectService . createProject ( user2 , workspace2 . slug , {
1229
- name : 'Forked Project' ,
1230
+ name : 'Forked Project 6 ' ,
1230
1231
description : 'Forked Project description' ,
1231
1232
storePrivateKey : true ,
1232
1233
accessLevel : ProjectAccessLevel . GLOBAL
@@ -1236,7 +1237,7 @@ describe('Project Controller Tests', () => {
1236
1237
method : 'POST' ,
1237
1238
url : `/project/${ project3 . slug } /fork` ,
1238
1239
payload : {
1239
- name : 'Forked Project'
1240
+ name : 'Forked Project 7 '
1240
1241
} ,
1241
1242
headers : {
1242
1243
'x-e2e-user-email' : user2 . email
@@ -1327,7 +1328,7 @@ describe('Project Controller Tests', () => {
1327
1328
user2 ,
1328
1329
project3 . slug ,
1329
1330
{
1330
- name : 'Forked Project'
1331
+ name : 'Forked Project 8 '
1331
1332
}
1332
1333
)
1333
1334
@@ -1454,7 +1455,7 @@ describe('Project Controller Tests', () => {
1454
1455
user2 ,
1455
1456
project3 . slug ,
1456
1457
{
1457
- name : 'Forked Project'
1458
+ name : 'Forked Project 9 '
1458
1459
}
1459
1460
)
1460
1461
@@ -1644,7 +1645,7 @@ describe('Project Controller Tests', () => {
1644
1645
user2 ,
1645
1646
project3 . slug ,
1646
1647
{
1647
- name : 'Forked Project'
1648
+ name : 'Forked Project 10 '
1648
1649
}
1649
1650
)
1650
1651
@@ -1779,7 +1780,7 @@ describe('Project Controller Tests', () => {
1779
1780
user2 ,
1780
1781
project3 . slug ,
1781
1782
{
1782
- name : 'Forked Project'
1783
+ name : 'Forked Project 11 '
1783
1784
}
1784
1785
)
1785
1786
@@ -1806,7 +1807,7 @@ describe('Project Controller Tests', () => {
1806
1807
1807
1808
it ( 'should be able to fetch all forked projects of a project' , async ( ) => {
1808
1809
await projectService . forkProject ( user2 , project3 . slug , {
1809
- name : 'Forked Project'
1810
+ name : 'Forked Project 12 '
1810
1811
} )
1811
1812
1812
1813
const response = await app . inject ( {
@@ -1856,31 +1857,31 @@ describe('Project Controller Tests', () => {
1856
1857
`${ Date . now ( ) } : Internal fork WorkspaceId: ${ hiddenProject . workspaceId } `
1857
1858
)
1858
1859
1859
- // // Make a public fork
1860
- // const publicProject = await projectService.forkProject(
1861
- // user2,
1862
- // project3.slug,
1863
- // {
1864
- // name: 'Forked Project'
1865
- // }
1866
- // )
1867
-
1868
- // console.log(
1869
- // `${Date.now()}: Public fork WorkspaceId: ${publicProject.workspaceId}`
1870
- // )
1871
-
1872
- // const response = await app.inject({
1873
- // method: 'GET',
1874
- // url: `/project/${project3.slug}/forks`,
1875
- // headers: {
1876
- // 'x-e2e-user-email': user1.email
1877
- // }
1878
- // })
1879
-
1880
- // console.log(`${Date.now()}: Get forks response: ${response.json()}`)
1881
-
1882
- // expect(response.statusCode).toBe(200)
1883
- // expect(response.json().items).toHaveLength(1)
1860
+ // Make a public fork
1861
+ const publicProject = await projectService . forkProject (
1862
+ user2 ,
1863
+ project3 . slug ,
1864
+ {
1865
+ name : 'Forked Project 13 '
1866
+ }
1867
+ )
1868
+
1869
+ console . log (
1870
+ `${ Date . now ( ) } : Public fork WorkspaceId: ${ publicProject . workspaceId } `
1871
+ )
1872
+
1873
+ const response = await app . inject ( {
1874
+ method : 'GET' ,
1875
+ url : `/project/${ project3 . slug } /forks` ,
1876
+ headers : {
1877
+ 'x-e2e-user-email' : user1 . email
1878
+ }
1879
+ } )
1880
+
1881
+ console . log ( `${ Date . now ( ) } : Get forks response: ${ response . json ( ) } ` )
1882
+
1883
+ expect ( response . statusCode ) . toBe ( 200 )
1884
+ expect ( response . json ( ) . items ) . toHaveLength ( 1 )
1884
1885
console . log ( `${ Date . now ( ) } : Test finished` )
1885
1886
} catch ( error ) {
1886
1887
console . error ( `${ Date . now ( ) } : Error: ${ error } ` )
0 commit comments