const {chromium}=require('playwright'); const path=require('path'); (async()=>{const browser=await chromium.launch({headless:true});try{const page=await browser.newPage();await page.setContent('');const frame=page.frames()[1];await frame.addScriptTag({path:path.resolve(__dirname,'../../PlotLine/wwwroot/js/writing-embedded-theme.js')});await frame.waitForFunction(()=>document.documentElement.getAttribute('data-app-theme')==='plum'&&document.documentElement.getAttribute('data-bs-theme')==='dark');await page.evaluate(()=>{document.documentElement.setAttribute('data-app-theme','sage');document.documentElement.removeAttribute('data-bs-theme');});await frame.waitForFunction(()=>document.documentElement.getAttribute('data-app-theme')==='sage'&&!document.documentElement.hasAttribute('data-bs-theme'));console.log('PASS embedded writing screens inherit and track existing PWA theme without separate persistence');}finally{await browser.close();}})().catch(e=>{console.error(e);process.exitCode=1;});