nested-in-react.test.js — astro Source File
Architecture documentation for nested-in-react.test.js, a javascript file in the astro codebase. 4 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR b63fb6fd_235b_b2e0_8b39_9fa869f256aa["nested-in-react.test.js"] 2ca394f6_a63d_3921_1f12_c5a979ea0039["test-utils.js"] b63fb6fd_235b_b2e0_8b39_9fa869f256aa --> 2ca394f6_a63d_3921_1f12_c5a979ea0039 e27f6887_ea47_dd44_7933_5faa0f6bcf4d["testFactory"] b63fb6fd_235b_b2e0_8b39_9fa869f256aa --> e27f6887_ea47_dd44_7933_5faa0f6bcf4d c373140e_7fdf_7fff_8884_991b85bc22b5["waitForHydrate"] b63fb6fd_235b_b2e0_8b39_9fa869f256aa --> c373140e_7fdf_7fff_8884_991b85bc22b5 f8fbe851_c5d6_c4ee_c044_67a751668c18["test"] b63fb6fd_235b_b2e0_8b39_9fa869f256aa --> f8fbe851_c5d6_c4ee_c044_67a751668c18 style b63fb6fd_235b_b2e0_8b39_9fa869f256aa fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { expect } from '@playwright/test';
import { testFactory, waitForHydrate } from './test-utils.js';
const test = testFactory(import.meta.url, { root: './fixtures/nested-in-react/' });
let devServer;
test.beforeAll(async ({ astro }) => {
devServer = await astro.startDevServer();
});
test.afterAll(async () => {
await devServer.stop();
});
test.describe('Nested Frameworks in React', () => {
test('No hydration mismatch', async ({ page, astro }) => {
// Get browser logs
const logs = [];
page.on('console', (msg) => logs.push(msg.text()));
await page.goto(astro.resolveUrl('/'));
// wait for root island to hydrate
const counter = page.locator('#react-counter');
await waitForHydrate(page, counter);
for (const log of logs) {
expect(log, 'React hydration mismatch').not.toMatch('An error occurred during hydration');
}
});
test('React counter', async ({ astro, page }) => {
await page.goto(astro.resolveUrl('/'));
const counter = page.locator('#react-counter');
await expect(counter, 'component is visible').toBeVisible();
const count = counter.locator('#react-counter-count');
await expect(count, 'initial count is 0').toHaveText('0');
await waitForHydrate(page, counter);
const increment = counter.locator('#react-counter-increment');
await increment.click();
await expect(count, 'count incremented by 1').toHaveText('1');
});
test('Preact counter', async ({ astro, page }) => {
await page.goto(astro.resolveUrl('/'));
const counter = page.locator('#preact-counter');
await expect(counter, 'component is visible').toBeVisible();
const count = counter.locator('#preact-counter-count');
await expect(count, 'initial count is 0').toHaveText('0');
await waitForHydrate(page, counter);
// ... (68 more lines)
Domain
Dependencies
Source
Frequently Asked Questions
What does nested-in-react.test.js do?
nested-in-react.test.js is a source file in the astro codebase, written in javascript. It belongs to the E2ETesting domain.
What does nested-in-react.test.js depend on?
nested-in-react.test.js imports 4 module(s): test, test-utils.js, testFactory, waitForHydrate.
Where is nested-in-react.test.js in the architecture?
nested-in-react.test.js is located at packages/astro/e2e/nested-in-react.test.js (domain: E2ETesting, directory: packages/astro/e2e).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free