Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update dRep form references url and link error testId #2240

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading