Skip to content

Commit

Permalink
Merge pull request #2240 from IntersectMBO/chore/update-dRep-form-ref…
Browse files Browse the repository at this point in the history
…erence-testId

chore: update dRep form references url and link error testId
  • Loading branch information
kneerose authored Oct 28, 2024
2 parents 5d33b50 + f0e58a8 commit a9764b9
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions tests/govtool-frontend/playwright/lib/forms/dRepForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ const formErrors = {
],
linkDescription: "max-80-characters-error",
email: "invalid-email-address-error",
link: "invalid-url-error",
links: {
url:"link-reference-description-1-error",
description: "link-reference-description-1-error",
},
identity: {
url: "identity-reference-url-1-error",
description: "identity-reference-description-1-error",
},
paymentAddress: "invalid-payment-address-error",
};

Expand Down Expand Up @@ -165,7 +172,8 @@ export default class DRepForm {
dRepInfo.qualifications
);

await expect(this.form.getByTestId(formErrors.link)).toBeHidden();
await expect(this.form.getByTestId(formErrors.links.url)).toBeHidden();
await expect(this.form.getByTestId(formErrors.identity.url)).toBeHidden();
await expect(this.form.getByTestId(formErrors.paymentAddress)).toBeHidden();
await expect(this.continueBtn).toBeEnabled();
}
Expand All @@ -190,7 +198,7 @@ export default class DRepForm {
})
.all();

expect(nameErrors.length).toBeGreaterThanOrEqual(1); // BUG duplicate test ids
expect(nameErrors.length).toBeGreaterThanOrEqual(1);

await expect(
this.form.getByTestId(formErrors.paymentAddress)
Expand All @@ -206,14 +214,14 @@ export default class DRepForm {
dRepInfo.qualifications
);

await expect(this.form.getByTestId(formErrors.link).first()).toBeVisible(); // BUG duplicate test ids
await expect(this.form.getByTestId(formErrors.links.url)).toBeVisible();
await expect(
this.form.getByTestId(formErrors.linkDescription).first()
).toBeVisible(); // BUG duplicate test ids
await expect(this.form.getByTestId(formErrors.link).last()).toBeVisible(); // BUG duplicate test ids
this.form.getByTestId(formErrors.links.description)
).toBeVisible();
await expect(this.form.getByTestId(formErrors.identity.url)).toBeVisible();
await expect(
this.form.getByTestId(formErrors.linkDescription).last()
).toBeVisible(); // BUG duplicate test ids
this.form.getByTestId(formErrors.identity.description)
).toBeVisible();

await expect(this.continueBtn).toBeDisabled();
}
Expand Down

0 comments on commit a9764b9

Please sign in to comment.