Skip to content

Commit

Permalink
Merge pull request #2488 from IntersectMBO/bugfix/proposal-test
Browse files Browse the repository at this point in the history
Update Test IDs and Validate Add Withdrawal Address Button Visibility in Proposal Form
  • Loading branch information
kneerose authored Dec 9, 2024
2 parents e6e91d4 + 6b5c09c commit 60a7bb1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const formErrors = {
abstract: "abstract-helper-error",
motivation: "motivation-helper-error",
rationale: "rationale-helper-error",
receivingAddress: "receiving-address-text-error",
amount: "amount-text-error",
receivingAddress: "receiving-address-0-text-error",
amount: "amount-0-text-error",
link: "link-0-url-input-error",
};

Expand All @@ -39,6 +39,9 @@ export default class ProposalSubmissionPage {

readonly continueBtn = this.page.getByTestId("continue-button");
readonly addLinkBtn = this.page.getByTestId("add-link-button");
readonly addWithdrawalAddressBtn = this.page.getByTestId(
"add-withdrawal-link-button"
);
readonly infoBtn = this.page.getByTestId("info-button");
readonly treasuryBtn = this.page.getByTestId("treasury-button");
readonly editSubmissionButton = this.page.getByTestId(
Expand All @@ -61,9 +64,9 @@ export default class ProposalSubmissionPage {
readonly motivationInput = this.page.getByTestId("motivation-input");
readonly rationaleInput = this.page.getByTestId("rationale-input");
readonly receivingAddressInput = this.page.getByTestId(
"receiving-address-input"
"receiving-address-0-text-input"
);
readonly amountInput = this.page.getByTestId("amount-input");
readonly amountInput = this.page.getByTestId("amount-0-text-input");
readonly closeDraftSuccessModalBtn = this.page.getByTestId("close-button");

constructor(private readonly page: Page) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,19 @@ test.describe("Proposal created logged state", () => {
await proposalSubmissionPage.validateForm(formFields);
}

if (type === ProposalType.treasury) {
for (let i = 0; i < 9; i++) {
await expect(
proposalSubmissionPage.addWithdrawalAddressBtn
).toBeVisible();
await proposalSubmissionPage.addWithdrawalAddressBtn.click();
}
}

await expect(
proposalSubmissionPage.addWithdrawalAddressBtn
).toBeHidden();

for (let i = 0; i < 6; i++) {
await expect(proposalSubmissionPage.addLinkBtn).toBeVisible();
await proposalSubmissionPage.addLinkBtn.click();
Expand Down

0 comments on commit 60a7bb1

Please sign in to comment.