Skip to content

Commit cc3e767

Browse files
committed
fix: show validation failing messages for proposal sorting
1 parent 4b0a348 commit cc3e767

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

tests/govtool-frontend/playwright/lib/pages/budgetDiscussionPage.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,11 @@ export default class BudgetDiscussionPage {
174174
// API validation
175175
for (let i = 0; i <= proposals.length - 2; i++) {
176176
const isValid = validationFn(proposals[i], proposals[i + 1]);
177-
expect(isValid).toBe(true);
177+
expect(isValid, {
178+
message:
179+
!isValid &&
180+
`Failed on sorting ${type} with proposals: ${proposals[i].id} and ${proposals[i + 1].id}`,
181+
}).toBe(true);
178182
}
179183
}
180184

tests/govtool-frontend/playwright/lib/pages/proposalDiscussionPage.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,11 @@ export default class ProposalDiscussionPage {
183183
// API validation
184184
for (let i = 0; i <= proposals.length - 2; i++) {
185185
const isValid = validationFn(proposals[i], proposals[i + 1]);
186-
expect(isValid).toBe(true);
186+
expect(isValid, {
187+
message:
188+
!isValid &&
189+
`Failed on sorting ${type} with proposals: ${proposals[i].id} and ${proposals[i + 1].id}`,
190+
}).toBe(true);
187191
}
188192
}
189193

0 commit comments

Comments
 (0)