Skip to content

Commit e99b365

Browse files
committed
feat: add test for updating the constitution proposal draft
1 parent ee09002 commit e99b365

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

tests/govtool-frontend/playwright/tests/7-proposal-submission/proposalSubmission.loggedin.spec.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
proposal05Wallet,
77
proposal06Wallet,
88
proposal07Wallet,
9+
proposal08Wallet,
910
} from "@constants/staticWallets";
1011
import { faker } from "@faker-js/faker";
1112
import { test } from "@fixtures/proposal";
@@ -544,3 +545,51 @@ test.describe("Treasury Proposal Draft", () => {
544545
);
545546
});
546547
});
548+
549+
test.describe("Update the constitution Proposal Draft", () => {
550+
test.use({ storageState: ".auth/proposal08.json", wallet: proposal08Wallet });
551+
552+
test("7M_3. Should edit update the constitution proposal draft", async ({
553+
page,
554+
}) => {
555+
await skipIfNotInfoAndBootstrapping(ProposalType.updatesToTheConstitution);
556+
557+
const proposalSubmissionPage = new ProposalSubmissionPage(page);
558+
const { proposalFormValue } = await proposalSubmissionPage.createDraft(
559+
ProposalType.updatesToTheConstitution
560+
);
561+
562+
const newTitle = faker.lorem.sentence(6);
563+
564+
await proposalSubmissionPage.viewFirstDraft();
565+
await proposalSubmissionPage.titleInput.fill(newTitle);
566+
await proposalSubmissionPage.continueBtn.click();
567+
568+
await expect(proposalSubmissionPage.governanceActionTypeContent).toHaveText(
569+
ProposalType.updatesToTheConstitution
570+
);
571+
await expect(proposalSubmissionPage.titleContent).toHaveText(newTitle);
572+
await expect(proposalSubmissionPage.abstractContent).toHaveText(
573+
proposalFormValue.prop_abstract
574+
);
575+
await expect(proposalSubmissionPage.motivationContent).toHaveText(
576+
proposalFormValue.prop_motivation
577+
);
578+
await expect(proposalSubmissionPage.rationaleContent).toHaveText(
579+
proposalFormValue.prop_rationale
580+
);
581+
await expect(proposalSubmissionPage.constitutionUrlContent).toHaveText(
582+
proposalFormValue.prop_constitution_url
583+
);
584+
await expect(proposalSubmissionPage.guardrailsScriptUrlContent).toHaveText(
585+
proposalFormValue.prop_guardrails_script_url
586+
);
587+
await expect(proposalSubmissionPage.guardrailsScriptHashContent).toHaveText(
588+
proposalFormValue.prop_guardrails_script_hash
589+
);
590+
591+
await expect(proposalSubmissionPage.linkTextContent).toHaveText(
592+
proposalFormValue.proposal_links[0].prop_link_text
593+
);
594+
});
595+
});

0 commit comments

Comments
 (0)