Skip to content

Commit 5b7ab88

Browse files
test: fix failing specs.
1 parent f388db4 commit 5b7ab88

2 files changed

Lines changed: 7 additions & 13 deletions

File tree

playwright/diagnostics.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ test('clear component diagnostics removes type errors and restores rendered stat
5252
),
5353
)
5454

55-
await page.getByRole('button', { name: 'Typecheck' }).click()
55+
await expect(
56+
page.locator('.editor-panel[data-editor-kind="component"] .cm-content').first(),
57+
).toContainText("const count: number = 'oops'")
58+
59+
await runTypecheck(page)
5660
const diagnosticsToggle = page.getByRole('button', { name: /^Diagnostics/ })
5761
await expect(diagnosticsToggle).toHaveClass(/diagnostics-toggle--error/)
5862
await expect(page.getByText(/Rendered \(Type errors: [1-9]\d*\)/)).toBeVisible()

playwright/rendering-modes.spec.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -195,21 +195,11 @@ test('react mode typecheck loads types without malformed URL fetches', async ({
195195
}
196196
})
197197

198-
await setComponentEditorSource(
199-
page,
200-
[
201-
"import React from 'react'",
202-
'const App = () => <button type="button">react types loaded</button>',
203-
].join('\n'),
204-
)
205-
206198
await page.getByRole('combobox', { name: 'Render mode' }).selectOption('react')
207-
await page.getByRole('button', { name: 'Typecheck' }).click()
199+
await runTypecheck(page)
208200

209201
await ensureDiagnosticsDrawerOpen(page)
210-
await expect(page.locator('#diagnostics-component')).toContainText(
211-
'No TypeScript errors found.',
212-
)
202+
await expect(page.locator('#diagnostics-component')).not.toContainText('Type checking…')
213203

214204
const diagnosticsText = await page.locator('#diagnostics-component').innerText()
215205
expect(diagnosticsText).not.toContain("Cannot find type definition file for 'react'")

0 commit comments

Comments
 (0)