import { expect, test } from 'bun:test'; import { createElement } from 'react'; import { renderToStaticMarkup } from 'react-dom/server'; import { MemoryRouter } from 'react-router-dom'; import { UnavailablePage } from '../../apps/stock/web-app/src/app/UnavailablePage'; import { navigation } from '../../apps/stock/web-app/src/lib/constants'; test('the shared desktop/mobile menu advertises working workflows only', () => { const hrefs = navigation.flatMap(item => [ item.href, ...(item.children?.map(child => child.href) ?? []), ]); for (const href of ['/portfolio', '/analytics', '/settings']) {expect(hrefs).not.toContain(href);} for (const href of [ '/strategies', '/backtests', '/research', '/experiments', '/paper', '/symbols', '/system/monitoring', ]) {expect(hrefs).toContain(href);} }); for (const name of ['Portfolio', 'Analytics', 'Settings']) { test(`${name} direct-page fallback explains availability and links to existing analytics`, () => { const html = renderToStaticMarkup( createElement(MemoryRouter, {}, createElement(UnavailablePage, { name })) ); expect(html).toContain(`${name} is not available`); expect(html).toContain('href="/backtests"'); expect(html).toContain('href="/experiments"'); expect(html).not.toContain('Coming Soon'); }); }