- Phase 2: dividend income — batch MOEX dividend fetching with buyDate filtering, UI cards - Phase 3: target allocation — backend targets parsing + deviation calc, frontend inputs + display - Add openapi-artifacts.spec.ts for checked-in contract verification - Regenerate frontend types from Swagger (auth/screener/portfolio paths)
28 lines
863 B
TypeScript
28 lines
863 B
TypeScript
import { readFileSync } from 'node:fs';
|
|
import { join, resolve } from 'node:path';
|
|
|
|
describe('checked-in OpenAPI artifacts', () => {
|
|
const rootDir = resolve(process.cwd(), '../..');
|
|
const frontendTypes = readFileSync(join(rootDir, 'apps/frontend/src/shared/api/types.ts'), 'utf8');
|
|
|
|
const requiredPaths = [
|
|
'/api/v1/auth/register',
|
|
'/api/v1/auth/login',
|
|
'/api/v1/auth/refresh',
|
|
'/api/v1/auth/logout',
|
|
'/api/v1/auth/me',
|
|
'/api/v1/securities/screener',
|
|
'/api/v1/portfolios',
|
|
'/api/v1/portfolios/{id}',
|
|
'/api/v1/portfolios/{id}/positions',
|
|
'/api/v1/portfolios/{id}/positions/{positionId}',
|
|
'/api/v1/portfolios/{id}/analytics',
|
|
];
|
|
|
|
it('frontend generated types include current protected domains', () => {
|
|
for (const path of requiredPaths) {
|
|
expect(frontendTypes).toContain(`'${path}'`);
|
|
}
|
|
});
|
|
});
|