@@ -92,7 +92,7 @@ describe("ProjectsService", async () => {
9292
9393 const foundProject = await ps . getProject ( stranger . id , project . id ) ;
9494 expect ( foundProject ?. id ) . to . equal ( project . id ) ;
95- // listing by org still doesn't woprk because strangers don't have access to the org
95+ // listing by org still doesn't work because strangers don't have access to the org
9696 await expectError ( ErrorCodes . NOT_FOUND , ( ) => ps . getProjects ( stranger . id , org . id ) ) ;
9797 } ) ;
9898
@@ -109,16 +109,18 @@ describe("ProjectsService", async () => {
109109
110110 expect ( await pdb . getProjectEnvironmentVariables ( project1 . id ) ) . to . have . lengthOf ( 1 ) ;
111111
112- await ps . deleteProject ( member . id , project1 . id ) ;
112+ await withTestCtx ( member , ( ) => ps . deleteProject ( member . id , project1 . id ) ) ;
113113 let projects = await ps . getProjects ( member . id , org . id ) ;
114114 expect ( projects . length ) . to . equal ( 0 ) ;
115115 // have to use db directly to verify the env vars are really deleted, the env var service would throw with project not found.
116116 expect ( await pdb . getProjectEnvironmentVariables ( project1 . id ) ) . to . have . lengthOf ( 0 ) ;
117117
118118 const project2 = await createTestProject ( ps , org , owner ) ;
119- await expectError ( ErrorCodes . NOT_FOUND , ( ) => ps . deleteProject ( stranger . id , project2 . id ) ) ;
119+ await withTestCtx ( stranger , ( ) =>
120+ expectError ( ErrorCodes . NOT_FOUND , ( ) => ps . deleteProject ( stranger . id , project2 . id ) ) ,
121+ ) ;
120122
121- await ps . deleteProject ( owner . id , project2 . id ) ;
123+ await withTestCtx ( owner , ( ) => ps . deleteProject ( owner . id , project2 . id ) ) ;
122124 projects = await ps . getProjects ( owner . id , org . id ) ;
123125 expect ( projects . length ) . to . equal ( 0 ) ;
124126 } ) ;
0 commit comments