Skip to content

Commit 909674e

Browse files
committed
Simplify 2.2i country test to field-presence check
The country select has no empty option, so selecting index 0 picks a valid country and the form advances on Continue, causing the subsequent restore selectOption('GB') to time out. Replace with a simpler assertion that the field is present and defaults to GB.
1 parent 425ace6 commit 909674e

1 file changed

Lines changed: 7 additions & 14 deletions

File tree

packages/join-e2e/tests/02-form-progression.spec.ts

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -109,20 +109,13 @@ test.describe('2.2 — Validation', () => {
109109
await assertRequiredValidation(page, 'input#addressPostcode', 'OX14PE');
110110
});
111111

112-
test('2.2i — country required', async ({ page }) => {
113-
// Country is a <select>; set it to an empty value to trigger validation.
114-
// Note: the country select has no empty option, so we select the first
115-
// option (index 0) which may be a non-GB country, then restore to GB.
116-
await page.locator('select#addressCountry').selectOption({ index: 0 });
117-
await page.locator(CONTINUE).click();
118-
// If the first option is a valid non-empty country the form will advance;
119-
// either way assert the select got the is-invalid class OR the stage
120-
// stayed on details — but do NOT require an error since a non-empty
121-
// country may be acceptable. The intent of 2.2i is to confirm the field
122-
// participates in validation when its value is missing.
123-
// We therefore skip any extra assertion here beyond the stage check.
124-
// (A truly empty country value cannot be triggered without an empty <option>.)
125-
await page.locator('select#addressCountry').selectOption('GB');
112+
test('2.2i — country field is present and pre-filled to GB', async ({ page }) => {
113+
// The country select has no empty option so a truly empty value cannot be
114+
// triggered. Assert instead that the field is present and defaults to GB
115+
// (confirming it participates in the form).
116+
const select = page.locator('select#addressCountry');
117+
await expect(select).toBeVisible();
118+
await expect(select).toHaveValue('GB');
126119
});
127120
});
128121

0 commit comments

Comments
 (0)