refactor: share research domain and simplify application workflows
This commit is contained in:
parent
805a9f8fd4
commit
8c39ccf7ea
58 changed files with 3805 additions and 3081 deletions
35
test/integration/navigation.test.tsx
Normal file
35
test/integration/navigation.test.tsx
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
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');
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue