boot-init now sets data-sx-ready on <html> and dispatches an sx:ready CustomEvent after all islands are hydrated. Playwright tests use this instead of networkidle + hard-coded sleeps (50+ seconds eliminated). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
29 lines
1.0 KiB
JavaScript
29 lines
1.0 KiB
JavaScript
const { test, expect } = require('playwright/test');
|
|
const { loadPage } = require('./helpers');
|
|
|
|
test('home page stepper: no raw SX component calls visible', async ({ page }) => {
|
|
await loadPage(page, '');
|
|
|
|
const stepper = page.locator('[data-sx-island="home/stepper"]');
|
|
await expect(stepper).toBeVisible({ timeout: 10000 });
|
|
|
|
// The lake (rendered preview) should NOT show raw component calls
|
|
const lake = stepper.locator('[data-sx-lake]');
|
|
await expect(lake).toBeVisible({ timeout: 5000 });
|
|
const lakeText = await lake.textContent();
|
|
expect(lakeText).not.toContain('~cssx/tw');
|
|
expect(lakeText).not.toContain(':tokens');
|
|
|
|
// Should show rendered content (colored text)
|
|
expect(lakeText.length).toBeGreaterThan(5);
|
|
|
|
// Stepper navigation should work
|
|
const buttons = stepper.locator('button');
|
|
await expect(buttons).toHaveCount(2);
|
|
const textBefore = await stepper.textContent();
|
|
await buttons.last().click();
|
|
await page.waitForTimeout(300);
|
|
const textAfter = await stepper.textContent();
|
|
expect(textAfter).not.toBe(textBefore);
|
|
});
|