mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-07-09 15:05:59 +00:00
fix(system-notices): fix FE-SN-BANNER-004 to reflect highest-priority-first array order
This commit is contained in:
@@ -72,17 +72,18 @@ describe('BannerRenderer', () => {
|
|||||||
expect(screen.getByText('Second notice')).toBeTruthy();
|
expect(screen.getByText('Second notice')).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('FE-SN-BANNER-004: third banner is not rendered (only last 2 shown)', async () => {
|
it('FE-SN-BANNER-004: third banner is not rendered (only top 2 shown)', async () => {
|
||||||
const n1 = makeBanner({ id: 'banner-1', titleKey: 'Oldest notice' });
|
// Server returns notices highest-priority first; BannerRenderer takes slice(0,2)
|
||||||
|
const n1 = makeBanner({ id: 'banner-1', titleKey: 'Highest notice' });
|
||||||
const n2 = makeBanner({ id: 'banner-2', titleKey: 'Second notice' });
|
const n2 = makeBanner({ id: 'banner-2', titleKey: 'Second notice' });
|
||||||
const n3 = makeBanner({ id: 'banner-3', titleKey: 'Newest notice' });
|
const n3 = makeBanner({ id: 'banner-3', titleKey: 'Lowest notice' });
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
render(<BannerRenderer notices={[n1, n2, n3]} />);
|
render(<BannerRenderer notices={[n1, n2, n3]} />);
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(screen.queryByText('Oldest notice')).toBeNull();
|
expect(screen.getByText('Highest notice')).toBeTruthy();
|
||||||
expect(screen.getByText('Second notice')).toBeTruthy();
|
expect(screen.getByText('Second notice')).toBeTruthy();
|
||||||
expect(screen.getByText('Newest notice')).toBeTruthy();
|
expect(screen.queryByText('Lowest notice')).toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('FE-SN-BANNER-005: critical banner has aria-live="assertive"', async () => {
|
it('FE-SN-BANNER-005: critical banner has aria-live="assertive"', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user