Files
Magent/scripts/review_issue_cards.cjs
T
Assclaw a3b5759708
Magent CI/CD / verify (push) Successful in 10m31s
Magent CI/CD / deploy-prod (push) Skipped
Magent CI/CD / deploy-beta (push) Skipped
Enforce recipient-bound single-use invites and fix issue card layout; clean release tooling
2026-09-07 19:59:51 +12:00

21 lines
2.1 KiB
JavaScript

const { chromium } = require(process.env.REVIEW_PLAYWRIGHT);
const fs = require('node:fs');
const assert = require('node:assert/strict');
(async () => {
const browser = await chromium.launch({ headless: true });
try {
const page = await browser.newPage();
const css = ['globals.css', 'ops-redesign.css', 'admin/config.css', 'account.css', 'workspace.css', 'portal/issue-flow.css'].map(p => fs.readFileSync(`frontend/app/${p}`, 'utf8')).join('\n');
for (const width of [320, 390, 1440]) {
await page.setViewportSize({ width, height: 900 });
await page.setContent(`<style>${css}</style><main class="issue-portal-page" style="display:block;width:100%;margin:0"><section class="portal-list-panel" style="width: min(100%, 360px);height:600px"><div class="portal-item-list">${Array.from({length: 8}, (_, i) => `<button class="portal-item-row"><div class="portal-item-row-main"><div class="portal-item-row-title"><strong>Issue ${i}: A long movie title with a missing episode and more details</strong><span class="small-pill">Broken media</span><span class="small-pill">Normal</span></div><p>Two lines of issue description to make sure this card expands correctly and does not overlap its neighbours.</p><div class="issue-card-progress">Reported — Step 1 of 6</div><div class="portal-item-row-meta"><span>#${i}</span><span>By: long-test-account@example.invalid</span><span>Updated: 9/7/2026, 10:00:00 PM</span></div></div></button>`).join('')}</div></section></main>`);
const bounds = await page.locator('.portal-item-row').evaluateAll(rows => rows.map(row => {
const r = row.getBoundingClientRect(), content = row.firstElementChild.getBoundingClientRect();
return {top:r.top,bottom:r.bottom,innerTop:content.top,innerBottom:content.bottom};
}));
bounds.forEach((r,i) => { assert(r.innerTop >= r.top); assert(r.innerBottom <= r.bottom); if(i) assert(r.top >= bounds[i-1].bottom + 7); });
console.log(`Issue card content and spacing passed at ${width}px`);
}
} finally { await browser.close(); }
})().catch(e => { console.error(e); process.exit(1); });