Skip to content

Commit ca8d2e5

Browse files
committed
fix: comment count issue
1 parent 521d2fd commit ca8d2e5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ test("11E. Should view comments with count indications on a budget proposal", as
187187
page,
188188
}) => {
189189
let responsePromise = page.waitForResponse((response) =>
190-
response.url().includes(`/api/comments`)
190+
response.url().includes(`/api/bds/`)
191191
);
192192

193193
const budgetDiscussionPage = new BudgetDiscussionPage(page);
@@ -197,13 +197,12 @@ test("11E. Should view comments with count indications on a budget proposal", as
197197
await budgetDiscussionPage.viewFirstProposal();
198198
const response = await responsePromise;
199199

200-
const comments: CommentResponse[] = (await response.json()).data;
201-
202-
await responsePromise;
200+
const proposalResponse = await response.json();
203201

204202
const actualTotalComments =
205203
await budgetDiscussionDetailsPage.totalComments.textContent();
206-
const expectedTotalComments = comments.length.toString();
204+
const expectedTotalComments =
205+
proposalResponse.data.attributes.prop_comments_number.toString();
207206
const isEqual = actualTotalComments === expectedTotalComments;
208207

209208
const currentPageUrl = budgetDiscussionDetailsPage.currentPage.url();

0 commit comments

Comments
 (0)