Skip to content

Commit fcab04f

Browse files
committed
feat: streamline wizard tests by removing unnecessary save button checks
1 parent 0b1b880 commit fcab04f

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

playwright/tests/wizard-free-text.spec.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,9 @@ test("wizard accepts custom free text answers and shows them in the summary", as
2626

2727
const customAnswer = "Feature pods with co-located tests"
2828
const customInput = page.getByPlaceholder("Type your custom preference")
29-
const saveButton = page.getByRole("button", { name: "Save custom answer" })
3029

3130
await expect(customInput).toBeVisible()
32-
await expect(saveButton).toBeDisabled()
33-
3431
await customInput.fill(customAnswer)
35-
await expect(saveButton).toBeEnabled()
36-
await saveButton.click()
3732

3833
const confirmationMessage = page.locator('p', { hasText: "We'll use" }).first()
3934
await expect(confirmationMessage).toBeVisible()

playwright/tests/wizard.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ test('wizard supports filtering, defaults, and reset', async ({ page }) => {
1717

1818
await expect(page.getByTestId('wizard-question-heading')).toHaveText('What build tooling do you use?')
1919

20+
const questionHeading = page.getByTestId('wizard-question-heading')
21+
2022
await page.getByRole('button', { name: /Use default/ }).click()
21-
await expect(page.getByRole('button', { name: /Use default/ })).toBeDisabled()
23+
await expect(questionHeading).toHaveText('What language do you use?')
2224

2325
await page.getByRole('button', { name: 'Start Over' }).click()
2426
await expect(page.getByTestId('wizard-confirmation-dialog')).toBeVisible()

0 commit comments

Comments
 (0)