File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -756,16 +756,14 @@ describe('Projects', () => {
756756 } ) ;
757757
758758 test ( 'assignment fails because the wbsElements do not match' , async ( ) => {
759- vi . spyOn ( prisma . material , 'findUnique' ) . mockResolvedValue ( {
760- ...prismaMaterial1 ,
761- wbsElementId : 1 ,
762- wbsElement : prismaWbsElement1
763- } ) ;
764- vi . spyOn ( prisma . assembly , 'findUnique' ) . mockResolvedValue ( {
759+ const material = { ...prismaMaterial1 , wbsElementId : 1 , wbsElement : prismaWbsElement1 } ;
760+ vi . spyOn ( prisma . material , 'findUnique' ) . mockResolvedValue ( material ) ;
761+ const assembly = {
765762 ...prismaAssembly1 ,
766763 wbsElementId : 2 ,
767764 wbsElement : { ...prismaWbsElement1 , wbsElementId : 2 , projectNumber : 1 }
768- } ) ;
765+ } ;
766+ vi . spyOn ( prisma . assembly , 'findUnique' ) . mockResolvedValue ( assembly ) ;
769767 await expect ( ProjectsService . assignMaterialAssembly ( superman , 'mid' , 'aid' ) ) . rejects . toThrow (
770768 new HttpException ( 400 , `The WBS element of the material (1.2.0) and assembly (1.1.0) do not match` )
771769 ) ;
You can’t perform that action at this time.
0 commit comments