Prepare clean production setup and coming-soon cover
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
const assert = require('node:assert/strict')
|
||||
const { chromium } = require(process.env.REVIEW_PLAYWRIGHT || 'playwright')
|
||||
;(async () => {
|
||||
const browser = await chromium.launch({ headless: true })
|
||||
try {
|
||||
const page = await browser.newPage()
|
||||
await page.route('**/api/**', route => route.fulfill({ json: {} }))
|
||||
await page.goto('http://127.0.0.1:3101/')
|
||||
assert.ok(page.url().endsWith('/coming-soon'))
|
||||
await page.getByRole('heading', { name: 'Your next watch. Made simpler.' }).waitFor()
|
||||
assert.equal(await page.locator('.header').count(), 0)
|
||||
assert.equal(await page.getByRole('link', { name: 'Admin sign in' }).getAttribute('href'), '/login')
|
||||
for (const width of [1440, 390]) {
|
||||
await page.setViewportSize({ width, height: 900 })
|
||||
assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth))
|
||||
if (process.env.REVIEW_DIR) await page.screenshot({ path: `${process.env.REVIEW_DIR}/coming-soon-${width}.png`, fullPage: true })
|
||||
}
|
||||
console.log('PASS: cover redirect, isolated layout, admin login link and responsive widths')
|
||||
} finally { await browser.close() }
|
||||
})().catch(error => { console.error(error); process.exitCode = 1 })
|
||||
Reference in New Issue
Block a user