import { test, expect } from './fixtures'; test.describe('Theme switching', () => { test('toggling the switch changes the body theme attribute', async ({ storefront, header }) => { await storefront.goto(); const initial = await header.currentTheme(); await header.themeToggle.click(); await expect(async () => { expect(await header.currentTheme()).not.toBe(initial); }).toPass(); }); test('theme preference persists across a reload', async ({ page, storefront, header }) => { await storefront.goto(); await header.themeToggle.click(); const chosen = await header.currentTheme(); await page.reload(); await expect(header.themedBody).toHaveAttribute('data-theme', chosen || ''); }); });