Skip to content

Commit b45d14f

Browse files
committed
#1528 - silly typescript error
1 parent f8da96e commit b45d14f

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

src/backend/tests/projects.test.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff 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
);

0 commit comments

Comments
 (0)