Skip to content

Commit 285a821

Browse files
authored
Merge pull request #3011 from IntersectMBO/tests/motion-of-no-confidence
Tests: motion of no confidence
2 parents 3073c1d + 1449fed commit 285a821

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

tests/govtool-frontend/playwright/lib/constants/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ export const SECURITY_RELEVANT_PARAMS_MAP: Record<string, string> = {
1111
minFeeRefScriptCostPerByte: "min_fee_ref_script_cost_per_byte",
1212
};
1313

14-
export const PROPOSAL_TYPE_FILTERS = [
15-
"Info Action",
16-
"Treasury requests",
17-
"Updates to the Constitution",
18-
];
1914
export const BOOTSTRAP_PROPOSAL_TYPE_FILTERS = ["Info Action"];
2015

2116
export const PROPOSAL_STATUS_FILTER = ["Submitted for vote", "Active proposal"];

tests/govtool-frontend/playwright/lib/pages/proposalDiscussionPage.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { expect, Locator, Page } from "@playwright/test";
2-
import { ProposalCreateRequest, ProposedGovAction } from "@types";
2+
import { ProposalCreateRequest, ProposalType, ProposedGovAction } from "@types";
33
import environments from "lib/constants/environments";
44
import ProposalDiscussionDetailsPage from "./proposalDiscussionDetailsPage";
5-
import { PROPOSAL_TYPE_FILTERS } from "@constants/index";
65

76
export default class ProposalDiscussionPage {
87
// Buttons
@@ -111,7 +110,7 @@ export default class ProposalDiscussionPage {
111110

112111
async clickRadioButtonsByNames(names: string[]) {
113112
for (const name of names) {
114-
const testId = PROPOSAL_TYPE_FILTERS.includes(name)
113+
const testId = Object.values(ProposalType).includes(name as ProposalType)
115114
? name.toLowerCase()
116115
: name.toLowerCase().replace(/ /g, "-");
117116
await this.page.getByTestId(`${testId}-radio`).click();

tests/govtool-frontend/playwright/lib/pages/proposalSubmissionPage.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ export default class ProposalSubmissionPage {
5858
readonly updateTheConstitutionBtn = this.page.getByTestId(
5959
"updates to the constitution-button"
6060
);
61+
readonly motionOfNoConfidenceBtn = this.page.getByTestId(
62+
"motion of no confidence-button"
63+
);
6164
readonly editSubmissionButton = this.page.getByTestId(
6265
"edit-submission-button"
6366
);
@@ -174,11 +177,13 @@ export default class ProposalSubmissionPage {
174177
await this.infoBtn.click();
175178
} else if (governanceProposal.gov_action_type_id === 1) {
176179
await this.treasuryBtn.click();
177-
} else {
180+
} else if (governanceProposal.gov_action_type_id === 2) {
178181
await this.updateTheConstitutionBtn.click();
179182
if (governanceProposal.has_guardrails) {
180183
await this.guardrailsScriptCheckbox.click();
181184
}
185+
} else {
186+
await this.motionOfNoConfidenceBtn.click();
182187
}
183188

184189
await this.fillupFormWithTypeSelected(governanceProposal);

tests/govtool-frontend/playwright/lib/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export enum ProposalType {
7373
info = "Info Action",
7474
treasury = "Treasury requests",
7575
updatesToTheConstitution = "Updates to the Constitution",
76+
motionOfNoConfedence = "Motion of No Confidence",
7677
}
7778

7879
export enum BootstrapGovernanceActionType {

tests/govtool-frontend/playwright/tests/8-proposal-discussion/proposalDiscussion.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import environments from "@constants/environments";
22
import {
33
BOOTSTRAP_PROPOSAL_TYPE_FILTERS,
44
PROPOSAL_STATUS_FILTER,
5-
PROPOSAL_TYPE_FILTERS,
65
} from "@constants/index";
76
import { faker } from "@faker-js/faker";
87
import { test } from "@fixtures/proposal";
@@ -50,7 +49,9 @@ test.describe("Filter and sort proposals", () => {
5049

5150
// proposal type filter
5251
await proposalDiscussionPage.applyAndValidateFilters(
53-
isBootStraping ? BOOTSTRAP_PROPOSAL_TYPE_FILTERS : PROPOSAL_TYPE_FILTERS,
52+
isBootStraping
53+
? BOOTSTRAP_PROPOSAL_TYPE_FILTERS
54+
: Object.values(ProposalType),
5455
proposalDiscussionPage._validateTypeFiltersInProposalCard
5556
);
5657

0 commit comments

Comments
 (0)