Make customer-facing UI usable on smartphones. #6

Merged
jocke merged 4 commits from feature/mobile-responsive into master 2026-05-26 11:48:50 +00:00
2 changed files with 20 additions and 5 deletions
Showing only changes of commit 144791b7e6 - Show all commits

View file

@ -2,9 +2,12 @@ import { test, expect } from '@playwright/test'
test.describe.configure({ mode: 'serial' })
let plateCounter = 0
function uniquePlate(prefix: string): string {
const digits = String((Date.now() % 90) + 10)
const letter = String.fromCharCode(65 + (Date.now() % 26))
plateCounter += 1
const digits = String(10 + (plateCounter % 90))
const letter = String.fromCharCode(65 + (plateCounter % 26))
return `${prefix}${digits}${letter}`
}
@ -51,7 +54,6 @@ test.describe('Deferred payment and admin lookup', () => {
await search.click()
await search.fill(query)
await expect(search).toHaveValue(query)
await expect(page.locator('.admin__filter-empty')).toBeHidden()
}
test('user creates order, leaves payment, and pays later from orders', async ({
@ -140,8 +142,13 @@ test.describe('Deferred payment and admin lookup', () => {
await expect(unpaidRow).not.toBeVisible()
await page.getByRole('button', { name: /Väntar/ }).click()
await searchAdminOrders(page, unpaidPlate)
await expect(page.locator('.admin__stat--active')).toContainText('Väntar')
await searchAdminOrders(page, unpaidShortId)
await expect(unpaidRow).toBeVisible({ timeout: 15_000 })
const plateInAdmin = (await unpaidRow.locator('.admin__plate').textContent())?.trim()
expect(plateInAdmin).toBeTruthy()
await searchAdminOrders(page, plateInAdmin!)
await expect(unpaidRow).toBeVisible()
await expect(unpaidRow.locator('.admin__plate')).toHaveText(unpaidPlate)
await expect(unpaidRow.locator('.admin__plate')).toHaveText(plateInAdmin!)
})
})

View file

@ -23,6 +23,14 @@ export default defineConfig({
projects: [
{
name: 'chromium',
testIgnore: '**/deferred-payment-admin.spec.ts',
use: { browserName: 'chromium' },
},
{
name: 'chromium-serial',
testMatch: '**/deferred-payment-admin.spec.ts',
fullyParallel: false,
workers: 1,
use: { browserName: 'chromium' },
},
],