diff options
Diffstat (limited to 'frontend/e2e/fixtures/news.fixtures.ts')
| -rw-r--r-- | frontend/e2e/fixtures/news.fixtures.ts | 137 |
1 files changed, 137 insertions, 0 deletions
diff --git a/frontend/e2e/fixtures/news.fixtures.ts b/frontend/e2e/fixtures/news.fixtures.ts new file mode 100644 index 0000000..e5a0baf --- /dev/null +++ b/frontend/e2e/fixtures/news.fixtures.ts @@ -0,0 +1,137 @@ +import type { NewsResponse, TickerOverview } from "../../types/api"; + +export const fetchedAt = "2026-06-22T12:00:00.000Z"; + +export const happyPath: NewsResponse = { + items: [ + { + id: "amd-ai-chip-ramp", + title: "AMD AI chip ramp lifts analyst outlook", + summary: "Analysts raised their revenue outlook as MI-series demand broadened across hyperscale buyers.", + source: "TechWire", + url: "https://example.test/news/amd-ai-chip-ramp", + sentiment: "bullish", + published_at: "2026-06-22T08:00:00.000Z" + }, + { + id: "amd-supply-chain-check", + title: "Supply checks show steady AMD server demand", + summary: "Channel checks pointed to stable enterprise orders and balanced inventory across distributors.", + source: "MarketWatch", + url: "https://example.test/news/amd-supply-chain-check", + sentiment: "neutral", + published_at: "2026-06-22T06:30:00.000Z" + }, + { + id: "amd-margin-pressure", + title: "AMD margin debate weighs on chip peers", + summary: "Investors weighed higher accelerator costs against a stronger data center backlog.", + source: "Reuters", + url: "https://example.test/news/amd-margin-pressure", + sentiment: "bearish", + published_at: "2026-06-22T04:15:00.000Z" + }, + { + id: "amd-gaming-cycle", + title: "Console cycle adds a slower but positive AMD catalyst", + summary: "A refreshed gaming cycle added a longer-dated revenue contributor outside the AI segment.", + source: "CNBC", + url: "https://example.test/news/amd-gaming-cycle", + sentiment: "bullish", + published_at: "2026-06-18T15:45:00.000Z" + } + ], + aggregate: { + buzz_articles_last_week: 42, + bullish_pct: 0.5, + neutral_pct: 0.25, + bearish_pct: 0.25 + }, + provider: "finnhub", + fetched_at: fetchedAt +}; + +export const fmpFallback: NewsResponse = { + ...happyPath, + provider: "fmp", + fetched_at: "2026-06-22T12:05:00.000Z" +}; + +export const serverError = { + detail: "news unavailable" +} as const; + +export const upstreamEmpty: NewsResponse = { + items: [], + aggregate: null, + provider: null, + fetched_at: "2026-06-22T12:10:00.000Z" +}; + +export const nullAggregate: NewsResponse = { + items: happyPath.items.slice(0, 3), + aggregate: null, + provider: "finnhub", + fetched_at: "2026-06-22T12:15:00.000Z" +}; + +export const overviewFixture: TickerOverview = { + profile: { + symbol: "AMD", + name: "Advanced Micro Devices, Inc.", + sector: "Technology", + industry: "Semiconductors", + exchange: "NASDAQ", + website: "https://www.amd.com", + summary: "AMD designs and sells microprocessors and related technologies.", + }, + quote: { + price: 145.5, + prev_close: 142.3, + change: 3.2, + change_pct: 0.0225, + }, + signals: [], + stats: { + market_cap: 235000000000, + trailing_pe: 35.4, + trailing_eps: 4.11, + volume: 45000000, + average_volume: 52000000, + beta: 1.65, + }, + ratios: { + price_to_book: 3.2, + price_to_sales: 7.1, + ev_to_sales: 6.8, + ev_to_ebitda: 28.5, + gross_margin_ttm: 0.48, + operating_margin_ttm: 0.08, + net_margin_ttm: 0.06, + roe_ttm: 0.04, + roa_ttm: 0.02, + roic_ttm: 0.03, + debt_to_equity: 0.15, + current_ratio: 2.4, + dividend_yield_ttm: null, + dividend_payout_ratio_ttm: null, + }, + range_52w: { + low: 100.0, + high: 200.0, + price: 145.5, + }, + short_interest: { + short_percent_of_float: 0.02, + short_ratio: 1.5, + shares_short: 15000000, + shares_short_prior_month: 14000000, + shares_short_delta_pct: 0.07, + }, + meta: { + status: "complete", + is_partial: false, + field_availability: {}, + sources: { "quote.price": "yahoo_finance" }, + }, +}; |
