Skip to content

Commit a9764b9

Browse files
authored
Merge pull request #2240 from IntersectMBO/chore/update-dRep-form-reference-testId
chore: update dRep form references url and link error testId
2 parents 5d33b50 + f0e58a8 commit a9764b9

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

tests/govtool-frontend/playwright/lib/forms/dRepForm.ts

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@ const formErrors = {
1212
],
1313
linkDescription: "max-80-characters-error",
1414
email: "invalid-email-address-error",
15-
link: "invalid-url-error",
15+
links: {
16+
url:"link-reference-description-1-error",
17+
description: "link-reference-description-1-error",
18+
},
19+
identity: {
20+
url: "identity-reference-url-1-error",
21+
description: "identity-reference-description-1-error",
22+
},
1623
paymentAddress: "invalid-payment-address-error",
1724
};
1825

@@ -165,7 +172,8 @@ export default class DRepForm {
165172
dRepInfo.qualifications
166173
);
167174

168-
await expect(this.form.getByTestId(formErrors.link)).toBeHidden();
175+
await expect(this.form.getByTestId(formErrors.links.url)).toBeHidden();
176+
await expect(this.form.getByTestId(formErrors.identity.url)).toBeHidden();
169177
await expect(this.form.getByTestId(formErrors.paymentAddress)).toBeHidden();
170178
await expect(this.continueBtn).toBeEnabled();
171179
}
@@ -190,7 +198,7 @@ export default class DRepForm {
190198
})
191199
.all();
192200

193-
expect(nameErrors.length).toBeGreaterThanOrEqual(1); // BUG duplicate test ids
201+
expect(nameErrors.length).toBeGreaterThanOrEqual(1);
194202

195203
await expect(
196204
this.form.getByTestId(formErrors.paymentAddress)
@@ -206,14 +214,14 @@ export default class DRepForm {
206214
dRepInfo.qualifications
207215
);
208216

209-
await expect(this.form.getByTestId(formErrors.link).first()).toBeVisible(); // BUG duplicate test ids
217+
await expect(this.form.getByTestId(formErrors.links.url)).toBeVisible();
210218
await expect(
211-
this.form.getByTestId(formErrors.linkDescription).first()
212-
).toBeVisible(); // BUG duplicate test ids
213-
await expect(this.form.getByTestId(formErrors.link).last()).toBeVisible(); // BUG duplicate test ids
219+
this.form.getByTestId(formErrors.links.description)
220+
).toBeVisible();
221+
await expect(this.form.getByTestId(formErrors.identity.url)).toBeVisible();
214222
await expect(
215-
this.form.getByTestId(formErrors.linkDescription).last()
216-
).toBeVisible(); // BUG duplicate test ids
223+
this.form.getByTestId(formErrors.identity.description)
224+
).toBeVisible();
217225

218226
await expect(this.continueBtn).toBeDisabled();
219227
}

0 commit comments

Comments
 (0)