// @ts-check const { test, expect } = require('@playwright/test'); const fs = require('fs'); const path = require('path'); const distDir = path.join(__dirname, '..', 'web', 'dist'); test.describe('Build output', () => { test('CSS cache-bust hash is present on style.css link', async () => { const html = fs.readFileSync(path.join(distDir, 'index.html'), 'utf-8'); expect(html).toMatch(/css\/style\.css\?h=[0-9a-f]{8}/); }); test('JS cache-bust hash is present on bundle.js script', async () => { const html = fs.readFileSync(path.join(distDir, 'index.html'), 'utf-8'); expect(html).toMatch(/bundle\.js\?h=[0-9a-f]{8}/); }); test('critical CSS is inlined with :root tokens', async () => { const html = fs.readFileSync(path.join(distDir, 'index.html'), 'utf-8'); // :root block should be inside an inline