mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-21 19:40:34 +00:00
feat(ui): a calm, native-looking card when a view fails or TREK was updated
The error and new-version fallback was a bordered box with a warning triangle and the raw error message on show. It is now one centred card with a round symbol (a friendly one for an update), a short title and line, and a full-width reload button; the technical message stays for issue reports, folded under Details. Phone, PWA and desktop alike.
This commit is contained in:
@@ -205,7 +205,20 @@ describe('ErrorBoundary', () => {
|
||||
);
|
||||
// --m-* only resolves inside MobileShell's .m-root; the desktop classes would
|
||||
// render an invisible card there.
|
||||
expect(screen.getByRole('alert').className).toContain('bg-m-card');
|
||||
expect(screen.getByRole('alert').querySelector('.bg-m-card')).not.toBeNull();
|
||||
expect(screen.getByRole('alert').querySelector('.bg-surface-card')).toBeNull();
|
||||
});
|
||||
|
||||
it('FE-COMP-ERRBOUND-014b: the technical message stays for an issue report, folded away', () => {
|
||||
render(
|
||||
<ErrorBoundary boundaryId="route" level="route">
|
||||
<Boom />
|
||||
</ErrorBoundary>,
|
||||
);
|
||||
// The message stays in the page for an issue report, inside a closed details.
|
||||
const details = screen.getByText('kaboom').closest('details') as HTMLDetailsElement;
|
||||
expect(details).not.toBeNull();
|
||||
expect(details.open).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user