Skip to content

Commit 75806c9

Browse files
test(website): add AST viewer test case (typescript-eslint#6275)
* test(website): Add AST viewer test case * Update packages/website/tests/playground.spec.ts * test(website): workaround for AST viewer failing test case * test(website): remove workaround for failing test --------- Co-authored-by: Josh Goldberg <git@joshuakgoldberg.com>
1 parent e94f24c commit 75806c9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

packages/website/tests/playground.spec.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,24 @@ test.describe('Playground', () => {
4747
await expect(page.getByText('let value: string[];')).toBeVisible();
4848
await expect(page.getByText('All is ok!')).toBeVisible();
4949
});
50+
51+
test('AST Viewer', async ({ page }) => {
52+
// 1. Type some valid code in the playground
53+
await writeInEditor(page, 'let value: Array<string>;');
54+
55+
// 2. Enable AST viewer
56+
await page
57+
.getByRole('combobox', { name: 'AST Viewer' })
58+
.selectOption({ label: 'ESTree' });
59+
60+
// 3. Type some valid code in the playground
61+
await writeInEditor(page, 'let value: Array<string>;');
62+
63+
// 4. Validate variable declaration block exists in AST viewer
64+
await expect(
65+
page.getByRole('link', { name: 'VariableDeclaration' }),
66+
).toBeVisible();
67+
});
5068
});
5169

5270
async function writeInEditor(page: Page, text: string): Promise<void> {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy