news screen enhancement - 1
This commit is contained in:
@@ -3,11 +3,7 @@ import assert from 'node:assert/strict';
|
||||
import { ScreenerController } from '../server/domains/screener/screener.controller.js';
|
||||
import { ScreenerEngine } from '../server/domains/screener/ScreenerEngine.js';
|
||||
|
||||
import type {
|
||||
LiveAssetResult,
|
||||
MarketContext,
|
||||
Stock,
|
||||
} from '../server/domains/shared/types/index.js';
|
||||
import type { LiveAssetResult, MarketContext } from '../server/domains/shared/types/index.js';
|
||||
import { ASSET_TYPE, SIGNAL } from '../server/domains/shared/config/constants.js';
|
||||
|
||||
// Mock implementations
|
||||
@@ -43,12 +39,24 @@ class MockScreenerEngine extends ScreenerEngine {
|
||||
returnOnEquity: 95.2,
|
||||
freeCashFlow: 100000000,
|
||||
}),
|
||||
} as unknown as Stock;
|
||||
} as unknown as LiveAssetResult['asset'];
|
||||
|
||||
const mockResult: LiveAssetResult = {
|
||||
asset: mockStock,
|
||||
fundamentalScore: { label: '✓ BUY', scoreSummary: 'Quality gate PASS' },
|
||||
inflatedScore: { label: '✓ BUY', scoreSummary: 'Market adjusted gate PASS' },
|
||||
fundamental: {
|
||||
label: '🟢 BUY (High Conviction)',
|
||||
tier: 'PASS',
|
||||
score: 9,
|
||||
scoreSummary: 'Quality gate PASS',
|
||||
audit: { passedGates: true },
|
||||
},
|
||||
inflated: {
|
||||
label: '🟢 BUY (High Conviction)',
|
||||
tier: 'PASS',
|
||||
score: 9,
|
||||
scoreSummary: 'Market adjusted gate PASS',
|
||||
audit: { passedGates: true },
|
||||
},
|
||||
signal: SIGNAL.STRONG_BUY,
|
||||
};
|
||||
|
||||
@@ -190,7 +198,7 @@ test('ScreenerController', async (t) => {
|
||||
assert.equal(results.STOCK.length, 1);
|
||||
const result = results.STOCK[0];
|
||||
assert.ok(result.signal);
|
||||
assert.ok(result.fundamentalScore);
|
||||
assert.ok(result.inflatedScore);
|
||||
assert.ok(result.fundamental);
|
||||
assert.ok(result.inflated);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user