Fix filings ticker scope consistency
This commit is contained in:
@@ -467,6 +467,47 @@ if (process.env.RUN_TASK_WORKFLOW_E2E === '1') {
|
||||
expect(task.payload.tags).toEqual(['semis', 'ai']);
|
||||
});
|
||||
|
||||
it('scopes the filings endpoint by ticker while leaving the global endpoint mixed', async () => {
|
||||
if (!sqliteClient) {
|
||||
throw new Error('sqlite client not initialized');
|
||||
}
|
||||
|
||||
seedFilingRecord(sqliteClient, {
|
||||
ticker: 'NVDA',
|
||||
accessionNumber: '0000000000-26-000110',
|
||||
filingType: '10-Q',
|
||||
filingDate: '2026-03-12',
|
||||
companyName: 'NVIDIA Corporation'
|
||||
});
|
||||
seedFilingRecord(sqliteClient, {
|
||||
ticker: 'MSFT',
|
||||
accessionNumber: '0000000000-26-000111',
|
||||
filingType: '10-K',
|
||||
filingDate: '2026-03-11',
|
||||
companyName: 'Microsoft Corporation'
|
||||
});
|
||||
|
||||
const scoped = await jsonRequest('GET', '/api/filings?ticker=NVDA&limit=120');
|
||||
expect(scoped.response.status).toBe(200);
|
||||
|
||||
const scopedFilings = (scoped.json as {
|
||||
filings: Array<{ ticker: string }>;
|
||||
}).filings;
|
||||
|
||||
expect(scopedFilings.length).toBeGreaterThan(0);
|
||||
expect(scopedFilings.every((filing) => filing.ticker === 'NVDA')).toBe(true);
|
||||
|
||||
const global = await jsonRequest('GET', '/api/filings?limit=120');
|
||||
expect(global.response.status).toBe(200);
|
||||
|
||||
const globalTickers = new Set((global.json as {
|
||||
filings: Array<{ ticker: string }>;
|
||||
}).filings.map((filing) => filing.ticker));
|
||||
|
||||
expect(globalTickers.has('NVDA')).toBe(true);
|
||||
expect(globalTickers.has('MSFT')).toBe(true);
|
||||
});
|
||||
|
||||
it('updates coverage status and archives while appending status-change journal history', async () => {
|
||||
const created = await jsonRequest('POST', '/api/watchlist', {
|
||||
ticker: 'amd',
|
||||
|
||||
Reference in New Issue
Block a user