summaryrefslogtreecommitdiff
path: root/frontend/e2e/fixtures/news.fixtures.ts
blob: e5a0baf23a72be2c277aeb4545e6b672927d9df2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
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" },
  },
};