Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,10 @@ const kuberService = {
},

multipleDRepRegistration: (metadataAndWallets: WalletAndAnchorType[]) => {
const kuber = new Kuber(faucetWallet.address, faucetWallet.payment.private);
const kuber = new Kuber(
proposalFaucetWallet.address,
proposalFaucetWallet.payment.private
);
const req = {
certificates: metadataAndWallets.map((metadataAndWallet) =>
Kuber.generateCert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ test.describe("Budget proposal logged in state", () => {
});

test("11I. Should comments on any proposal", async ({}) => {
const comment = faker.lorem.paragraph(2);
const comment = faker.lorem.paragraph(1);
await budgetDiscussionDetailsPage.addComment(comment);
await expect(
budgetDiscussionDetailsPage.currentPage
Expand All @@ -59,7 +59,7 @@ test.describe("Budget proposal logged in state", () => {
});

test("11J. Should reply to any comments", async ({}) => {
const randComment = faker.lorem.paragraph(2);
const randComment = faker.lorem.paragraph(1);
const randReply = faker.lorem.words(5);

await budgetDiscussionDetailsPage.addComment(randComment);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ test("11E. Should view comments with count indications on a budget proposal", as
page,
}) => {
let responsePromise = page.waitForResponse((response) =>
response.url().includes(`/api/comments`)
response.url().includes(`/api/bds/`)
);

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

const comments: CommentResponse[] = (await response.json()).data;
const proposalResponse = await response.json();

await responsePromise;
const actualTotalComments =
await budgetDiscussionDetailsPage.totalComments.textContent();
const expectedTotalComments =
proposalResponse.data.attributes.prop_comments_number.toString();
const isEqual = actualTotalComments === expectedTotalComments;

await expect(budgetDiscussionDetailsPage.totalComments).toHaveText(
comments.length.toString()
);
const currentPageUrl = budgetDiscussionDetailsPage.currentPage.url();

const proposalId = extractProposalIdFromUrl(currentPageUrl);

await expect(
budgetDiscussionDetailsPage.totalComments,
!isEqual &&
`Total comments do not match in ${environments.frontendUrl}/budget_discussion/${proposalId}`
).toHaveText(expectedTotalComments);
});

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