const assert=require('node:assert/strict'); (async()=>{const b=await require('./support/browser.cjs').launchBrowser();try{ const p=await b.newPage({viewport:{width:1280,height:950}});await p.goto('http://127.0.0.1:3000');await p.getByLabel('Username',{exact:true}).fill('alice');await p.getByLabel('Password',{exact:true}).fill('meguri-demo-only');await p.getByRole('button',{name:'Sign in',exact:true}).click();await p.waitForFunction(()=>Alpine.$data(document.body).workspace); await p.evaluate(()=>{const a=Alpine.$data(document.body),alice=a.user.id,bob=a.people.find(x=>x.display_name==='Bob Chen').id,schedule=a.doc.schedules[0].id; a.doc.requests=[{id:'test',status:'pending',required_approvers:[alice,bob],approvals:[alice],legs:[{schedule_id:schedule,from_user:alice,to_user:bob,start:'2026-10-08T11:00:00+03:00',end:'2026-10-10T08:00:00.000Z'}]}];a.detail.coverage={total:1,issues:[{schedule_id:schedule,user_id:alice,start:'2026-10-08T08:00:00Z',end:'2026-10-11T08:00:00Z'}]};}); const box=p.locator('.coverage-problems');await box.waitFor({state:'visible'});assert.equal(await box.locator('.coverage-issue').count(),2);await box.getByText('Waiting for: Bob Chen',{exact:true}).waitFor();assert.equal(await box.getByText('No substitute assigned',{exact:true}).count(),1);assert.equal(await box.getByText('Awaiting approval',{exact:true}).count(),1); const parts=await p.evaluate(()=>Alpine.$data(document.body).coverageItems);assert.equal(parts[0].end,parts[1].start);assert.equal(parts[1].start,'2026-10-10T08:00:00.000Z');assert(!parts[1].awaiting); const strong=await box.locator('strong').first().boundingBox(),time=await box.locator('.coverage-times').first().boundingBox();assert(time.y>=strong.y+strong.height+6);await box.screenshot({path:'test-results/coverage-status.png'}); await p.setViewportSize({width:390,height:844});await box.screenshot({path:'test-results/coverage-status-mobile.png'});assert((await box.boundingBox()).width<=390);await box.getByRole('button',{name:'View requests'}).click();assert.equal(await p.evaluate(()=>Alpine.$data(document.body).view),'requests');console.log('PASS pending versus missing coverage, partial intervals, outstanding approvers, request navigation and responsive spacing'); }finally{await b.close();}})().catch(e=>{console.error(e);process.exitCode=1;});