Skip to content

Commit 521d2fd

Browse files
committed
chore: add proper messge for comment length invalid issue
1 parent dd5072b commit 521d2fd

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.spec.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,20 @@ test("11E. Should view comments with count indications on a budget proposal", as
201201

202202
await responsePromise;
203203

204-
await expect(budgetDiscussionDetailsPage.totalComments).toHaveText(
205-
comments.length.toString()
206-
);
204+
const actualTotalComments =
205+
await budgetDiscussionDetailsPage.totalComments.textContent();
206+
const expectedTotalComments = comments.length.toString();
207+
const isEqual = actualTotalComments === expectedTotalComments;
208+
209+
const currentPageUrl = budgetDiscussionDetailsPage.currentPage.url();
210+
211+
const proposalId = extractProposalIdFromUrl(currentPageUrl);
212+
213+
await expect(
214+
budgetDiscussionDetailsPage.totalComments,
215+
!isEqual &&
216+
`Total comments do not match in ${environments.frontendUrl}/budget_discussion/${proposalId}`
217+
).toHaveText(expectedTotalComments);
207218
});
208219

209220
test.describe("Restricted access to interact budget proposal", () => {

0 commit comments

Comments
 (0)