Skip to content

Commit de9f440

Browse files
JosephRana11kneerose
authored andcommitted
chore: run lint formatter
1 parent 160aaf1 commit de9f440

File tree

7 files changed

+72
-71
lines changed

7 files changed

+72
-71
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const proposal06AuthFile = ".auth/proposal06.json";
2020
export const proposal07AuthFile = ".auth/proposal07.json";
2121
export const proposal08AuthFile = ".auth/proposal08.json";
2222
export const proposal09AuthFile = ".auth/proposal09.json";
23-
export const proposal10AuthFile = '.auth/proposal10.json';
23+
export const proposal10AuthFile = ".auth/proposal10.json";
2424

2525
export const proposalSubmissionAuthFile = ".auth/proposalSubmission.json";
2626

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const proposal06Wallet: StaticWallet = staticWallets[15];
2525
export const proposal07Wallet: StaticWallet = staticWallets[16];
2626
export const proposal08Wallet: StaticWallet = staticWallets[17];
2727
export const proposal09Wallet: StaticWallet = staticWallets[18];
28-
export const proposal10Wallet: StaticWallet = staticWallets[19]
28+
export const proposal10Wallet: StaticWallet = staticWallets[19];
2929

3030
export const budgetProposal01Wallet: StaticWallet = staticWallets[20];
3131
export const budgetProposal02Wallet: StaticWallet = staticWallets[21];

tests/govtool-frontend/playwright/lib/helpers/auth.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ export const getDraftProposalWalletAndState = (proposalType: string) => {
126126
};
127127
case ProposalType.hardFork:
128128
return {
129-
storageState : proposal10AuthFile,
130-
wallet: proposal10Wallet
131-
}
129+
storageState: proposal10AuthFile,
130+
wallet: proposal10Wallet,
131+
};
132132
}
133133
};

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

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ const formErrors = {
3030
constitutionalUrl: "prop-constitution-url-text-error",
3131
guardrailsScriptUrl: "prop-guardrails-script-url-input-error",
3232
link: "link-0-url-input-error",
33-
majorError : "major-error",
34-
minorError : "minor-error"
33+
majorError: "major-error",
34+
minorError: "minor-error",
3535
};
3636

3737
export default class ProposalSubmissionPage {
@@ -63,9 +63,7 @@ export default class ProposalSubmissionPage {
6363
readonly motionOfNoConfidenceBtn = this.page.getByTestId(
6464
"motion of no confidence-button"
6565
);
66-
readonly hardForkBtn = this.page.getByTestId(
67-
"hard fork-button"
68-
)
66+
readonly hardForkBtn = this.page.getByTestId("hard fork-button");
6967
readonly editSubmissionButton = this.page.getByTestId(
7068
"edit-submission-button"
7169
);
@@ -106,10 +104,12 @@ export default class ProposalSubmissionPage {
106104
readonly closeDraftSuccessModalBtn = this.page.getByTestId("close-button");
107105
readonly linkTextInput = this.page.getByTestId("link-0-text-input");
108106
readonly linkUrlInput = this.page.getByTestId("link-0-url-input");
109-
readonly previousGAHashInput = this.page.getByTestId("previous-ga-hash-input");
107+
readonly previousGAHashInput = this.page.getByTestId(
108+
"previous-ga-hash-input"
109+
);
110110
readonly previousGAIdInput = this.page.getByTestId("previous-ga-id-input");
111-
readonly majorInput = this.page.getByTestId("major-input")
112-
readonly minorInput = this.page.getByTestId("minor-input")
111+
readonly majorInput = this.page.getByTestId("major-input");
112+
readonly minorInput = this.page.getByTestId("minor-input");
113113

114114
// content
115115
readonly governanceActionTypeContent = this.page.getByTestId(
@@ -134,8 +134,8 @@ export default class ProposalSubmissionPage {
134134
);
135135
readonly linkTextContent = this.page.getByTestId("link-0-text-content");
136136
readonly linkUrlContent = this.page.getByTestId("link-0-url-content");
137-
readonly majorVersionContent = this.page.getByTestId("major-version-content")
138-
readonly minorVersionContent = this.page.getByTestId("minor-version-content")
137+
readonly majorVersionContent = this.page.getByTestId("major-version-content");
138+
readonly minorVersionContent = this.page.getByTestId("minor-version-content");
139139

140140
constructor(private readonly page: Page) {}
141141

@@ -184,14 +184,13 @@ export default class ProposalSubmissionPage {
184184
await this.fillProposalLinks(governanceProposal.proposal_links);
185185
}
186186

187-
if(governanceProposal.gov_action_type_id == 4){
188-
await this.fillHardForkFields(governanceProposal)
189-
}
187+
if (governanceProposal.gov_action_type_id == 4) {
188+
await this.fillHardForkFields(governanceProposal);
189+
}
190190
}
191191

192192
async fillupForm(governanceProposal: ProposalCreateRequest) {
193-
194-
console.log(governanceProposal.gov_action_type_id)
193+
console.log(governanceProposal.gov_action_type_id);
195194
await this.governanceActionType.click();
196195

197196
if (governanceProposal.gov_action_type_id === 0) {
@@ -206,7 +205,7 @@ export default class ProposalSubmissionPage {
206205
} else if (governanceProposal.gov_action_type_id === 3) {
207206
await this.motionOfNoConfidenceBtn.click();
208207
} else {
209-
await this.hardForkBtn.click()
208+
await this.hardForkBtn.click();
210209
}
211210

212211
await this.fillupFormWithTypeSelected(governanceProposal);
@@ -257,9 +256,9 @@ export default class ProposalSubmissionPage {
257256
}
258257
}
259258

260-
async fillHardForkFields(hardForkProposal : ProposalCreateRequest){
261-
await this.minorInput.fill(hardForkProposal.prop_min_version.toString())
262-
await this.majorInput.fill(hardForkProposal.prop_major_version.toString())
259+
async fillHardForkFields(hardForkProposal: ProposalCreateRequest) {
260+
await this.minorInput.fill(hardForkProposal.prop_min_version.toString());
261+
await this.majorInput.fill(hardForkProposal.prop_major_version.toString());
263262
}
264263

265264
async getAllDrafts() {
@@ -378,15 +377,15 @@ export default class ProposalSubmissionPage {
378377
.isVisible();
379378

380379
await expect(this.page.getByTestId(formErrors.majorError), {
381-
message: isMajorErrorVisible
382-
? 'Major version error should be hidden'
383-
: 'Major version error is correctly hidden'
380+
message: isMajorErrorVisible
381+
? "Major version error should be hidden"
382+
: "Major version error is correctly hidden",
384383
}).toBeHidden();
385384

386385
await expect(this.page.getByTestId(formErrors.minorError), {
387-
message: isMinorErrorVisible
388-
? 'Minor version error should be hidden'
389-
: 'Minor version error is correctly hidden'
386+
message: isMinorErrorVisible
387+
? "Minor version error should be hidden"
388+
: "Minor version error is correctly hidden",
390389
}).toBeHidden();
391390
}
392391

@@ -502,9 +501,9 @@ export default class ProposalSubmissionPage {
502501
}).toBeVisible();
503502
}
504503

505-
if (governanceProposal.gov_action_type_id === 4){
506-
await expect(this.page.getByTestId(formErrors.majorError)).toBeVisible()
507-
await expect(this.page.getByTestId(formErrors.minorError)).toBeVisible()
504+
if (governanceProposal.gov_action_type_id === 4) {
505+
await expect(this.page.getByTestId(formErrors.majorError)).toBeVisible();
506+
await expect(this.page.getByTestId(formErrors.minorError)).toBeVisible();
508507
}
509508

510509
await expect(this.continueBtn).toBeDisabled();
@@ -562,9 +561,13 @@ export default class ProposalSubmissionPage {
562561
}
563562
}
564563
}
565-
if (proposalType == ProposalType.hardFork){
566-
proposal.prop_min_version = faker.number.float({min:0 , max:100}).toString()
567-
proposal.prop_major_version = faker.number.float({min:0 , max:100}).toString()
564+
if (proposalType == ProposalType.hardFork) {
565+
proposal.prop_min_version = faker.number
566+
.float({ min: 0, max: 100 })
567+
.toString();
568+
proposal.prop_major_version = faker.number
569+
.float({ min: 0, max: 100 })
570+
.toString();
568571
}
569572

570573
return proposal;
@@ -602,12 +605,11 @@ export default class ProposalSubmissionPage {
602605
proposal.prop_guardrails_script_hash = faker.string.alphanumeric(64);
603606
}
604607

605-
if (proposalType === ProposalType.hardFork){
606-
proposal.prop_min_version = invalid.amount()
607-
proposal.prop_major_version = invalid.amount()
608+
if (proposalType === ProposalType.hardFork) {
609+
proposal.prop_min_version = invalid.amount();
610+
proposal.prop_major_version = invalid.amount();
608611
}
609612

610-
611613
return proposal;
612614
}
613615

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export enum ProposalType {
8383
treasury = "Treasury requests",
8484
updatesToTheConstitution = "Updates to the Constitution",
8585
motionOfNoConfedence = "Motion of No Confidence",
86-
hardFork = "Hard fork"
86+
hardFork = "Hard fork",
8787
}
8888

8989
export enum BootstrapGovernanceActionType {
@@ -196,8 +196,8 @@ export type ProposalCreateRequest = {
196196
prop_guardrails_script_hash?: string;
197197
has_guardrails?: boolean;
198198
is_draft: boolean;
199-
prop_min_version? : string;
200-
prop_major_version? : string;
199+
prop_min_version?: string;
200+
prop_major_version?: string;
201201
};
202202
export type ProposedGovAction = {
203203
id: number;

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

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -188,18 +188,17 @@ test.describe("Proposal created logged state", () => {
188188
).toHaveText(proposal.prop_guardrails_script_hash);
189189
}
190190

191-
if (type == ProposalType.hardFork){
192-
await expect(
193-
proposalSubmissionPage.majorVersionContent
194-
).toHaveText(proposal.prop_major_version)
195-
await expect(
196-
proposalSubmissionPage.minorVersionContent
197-
).toHaveText(proposal.prop_min_version)
191+
if (type == ProposalType.hardFork) {
192+
await expect(proposalSubmissionPage.majorVersionContent).toHaveText(
193+
proposal.prop_major_version
194+
);
195+
await expect(proposalSubmissionPage.minorVersionContent).toHaveText(
196+
proposal.prop_min_version
197+
);
198198
}
199199
// cleanup
200200
await proposalDetailsPage.deleteProposal();
201201
});
202-
203202
});
204203
});
205204

@@ -266,15 +265,14 @@ test.describe("Proposal created logged state", () => {
266265
).toHaveText(proposal.prop_guardrails_script_hash);
267266
}
268267

269-
if (type === ProposalType.hardFork){
270-
await expect(
271-
proposalSubmissionPage.minorVersionContent
272-
).toHaveText(proposal.prop_min_version);
273-
await expect(
274-
proposalSubmissionPage.majorVersionContent
275-
).toHaveText(proposal.prop_major_version)
268+
if (type === ProposalType.hardFork) {
269+
await expect(proposalSubmissionPage.minorVersionContent).toHaveText(
270+
proposal.prop_min_version
271+
);
272+
await expect(proposalSubmissionPage.majorVersionContent).toHaveText(
273+
proposal.prop_major_version
274+
);
276275
}
277-
278276
});
279277
});
280278
});
@@ -324,13 +322,14 @@ test.describe("Proposal created logged state", () => {
324322
).toBeVisible();
325323
}
326324

327-
if (type === ProposalType.hardFork){
328-
await expect(proposalSubmissionPage.previousGAHashInput).toBeVisible()
329-
await expect(proposalSubmissionPage.previousGAIdInput).toBeVisible()
330-
await expect(proposalSubmissionPage.majorInput).toBeVisible()
331-
await expect(proposalSubmissionPage.minorInput).toBeVisible()
325+
if (type === ProposalType.hardFork) {
326+
await expect(
327+
proposalSubmissionPage.previousGAHashInput
328+
).toBeVisible();
329+
await expect(proposalSubmissionPage.previousGAIdInput).toBeVisible();
330+
await expect(proposalSubmissionPage.majorInput).toBeVisible();
331+
await expect(proposalSubmissionPage.minorInput).toBeVisible();
332332
}
333-
334333
});
335334
});
336335
});
@@ -457,10 +456,10 @@ test.describe("Proposal Draft", () => {
457456
if (createProposalType === ProposalType.hardFork) {
458457
await expect(proposalSubmissionPage.majorInput).toHaveValue(
459458
proposalFormValue.prop_major_version
460-
)
459+
);
461460
await expect(proposalSubmissionPage.minorInput).toHaveValue(
462461
proposalFormValue.prop_min_version
463-
)
462+
);
464463
}
465464

466465
await expect(proposalSubmissionPage.linkUrlInput).toHaveValue(
@@ -550,11 +549,11 @@ test.describe("Proposal Draft", () => {
550549
if (proposalType === ProposalType.hardFork) {
551550
await expect(proposalSubmissionPage.majorVersionContent).toHaveText(
552551
proposalFormValue.prop_major_version
553-
)
552+
);
554553
await expect(proposalSubmissionPage.minorVersionContent).toHaveText(
555554
proposalFormValue.prop_min_version
556-
)
557-
}
555+
);
556+
}
558557
});
559558
});
560559

tests/govtool-frontend/playwright/tests/proposal-discussion.auth.setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const proposalSetups = [
4141
{ name: "Proposal 07", wallet: proposal07Wallet, auth: proposal07AuthFile },
4242
{ name: "Proposal 08", wallet: proposal08Wallet, auth: proposal08AuthFile },
4343
{ name: "Proposal 09", wallet: proposal09Wallet, auth: proposal09AuthFile },
44-
{ name: "Proposal 10", wallet: proposal10Wallet, auth: proposal10AuthFile }
44+
{ name: "Proposal 10", wallet: proposal10Wallet, auth: proposal10AuthFile },
4545
];
4646

4747
for (const { name, wallet, auth } of proposalSetups) {

0 commit comments

Comments
 (0)