fix(app): failure row fits Réessayer and Consulter side by side
Board 30: in a three-column card at 1280 px the two buttons wrapped by a few pixels. The failure row narrows their padding only there; the wrap stays as the fallback. The network e2e now checks both on one row.
This commit is contained in:
1 parent
2930f4919f
commit
1e5058577f
2 files changed
+12
-1
No files matched your search
@@ -181,6 +181,14 @@ function countsText(dict: Dict): string {
|
||||
return `${counted(views, 'catalogue.card.views')}, ${counted(zones, 'catalogue.card.zones')}`
|
||||
}
|
||||
|
||||
/** Board 30: « Réessayer » and « Consulter » side by side, on one row. */
|
||||
async function expectOneRow(first: Locator, second: Locator) {
|
||||
const [a, b] = [await first.boundingBox(), await second.boundingBox()]
|
||||
expect(a && b, 'both buttons laid out').toBeTruthy()
|
||||
expect(Math.abs(a!.y - b!.y), 'same row').toBeLessThan(1)
|
||||
expect(b!.x, 'side by side').toBeGreaterThanOrEqual(a!.x + a!.width)
|
||||
}
|
||||
|
||||
async function expectAtLeast44High(target: Locator, what: string) {
|
||||
const box = await target.boundingBox()
|
||||
expect(box, `${what} box`).not.toBeNull()
|
||||
@@ -289,6 +297,7 @@ test.describe('catalogue card network failure (fr)', () => {
|
||||
consultOf(soundCard, dict, sound),
|
||||
'« Consulter » beside « Réessayer »',
|
||||
)
|
||||
await expectOneRow(retry, consultOf(soundCard, dict, sound))
|
||||
await expectListLayout(page, 'the network line')
|
||||
|
||||
await context.unroute(VERSION_RPC, lose)
|
||||
|
||||
@@ -54,7 +54,9 @@ export default function CardFailure({ failed, onRetry, retryRef, children }: Car
|
||||
{!retrying && attempt > 0 ? text : ''}
|
||||
</div>
|
||||
)}
|
||||
<div className="mt-auto flex flex-wrap gap-2">
|
||||
{/* Narrower padding in this row only: both buttons fit side by side in
|
||||
a three-column card (board 30); the wrap stays as the fallback. */}
|
||||
<div className="mt-auto flex flex-wrap gap-2 *:px-3">
|
||||
{retry && (
|
||||
<Button
|
||||
ref={retryRef}
|
||||
|
||||
Reference in new issue
Block a user