Skip to content

Commit f41a235

Browse files
committed
fix: correct test assertions for CI
- Use exact error string in moveElement rejection test - Use raw SQL to create CONTEXT element, bypassing validation middleware
1 parent edc5a28 commit f41a235

2 files changed

Lines changed: 6 additions & 12 deletions

File tree

src/__tests__/integration/element-service.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ describe("element-service", () => {
775775
// Moving a strategy under evidence should fail
776776
expectError(
777777
await moveElement(user.id, strategy.id, evidence.id),
778-
"cannot be a child of"
778+
"strategy cannot be a child of evidence"
779779
);
780780
});
781781
});

src/__tests__/integration/identifier-service.test.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,11 @@ describe("identifier-service", () => {
9191
})
9292
);
9393

94-
// Manually create a context element
95-
await prisma.assuranceElement.create({
96-
data: {
97-
caseId: testCase.id,
98-
elementType: "CONTEXT",
99-
parentId: goal.id,
100-
name: "X1",
101-
description: "Test context",
102-
createdById: user.id,
103-
},
104-
});
94+
// Create a context element bypassing element validation middleware
95+
await prisma.$executeRaw`
96+
INSERT INTO "AssuranceElement" (id, "caseId", "elementType", "parentId", name, description, "createdById", "createdAt", "updatedAt")
97+
VALUES (gen_random_uuid(), ${testCase.id}, 'CONTEXT', ${goal.id}, 'X1', 'Test context', ${user.id}, NOW(), NOW())
98+
`;
10599

106100
await resetIdentifiers(testCase.id, user.id);
107101

0 commit comments

Comments
 (0)