Run playwright UI tests
This commit is contained in:
@@ -2,13 +2,15 @@ export const queryKeys = {
|
||||
companyAnalysis: (ticker: string) => ['analysis', ticker] as const,
|
||||
companyFinancialStatements: (
|
||||
ticker: string,
|
||||
mode: string,
|
||||
statement: string,
|
||||
window: string,
|
||||
includeDimensions: boolean,
|
||||
includeFacts: boolean,
|
||||
factsCursor: string | null,
|
||||
factsLimit: number,
|
||||
cursor: string | null,
|
||||
limit: number
|
||||
) => ['financials-v2', ticker, mode, statement, window, includeDimensions ? 'dims' : 'no-dims', cursor ?? '', limit] as const,
|
||||
) => ['financials-v3', ticker, statement, window, includeDimensions ? 'dims' : 'no-dims', includeFacts ? 'facts' : 'rows', factsCursor ?? '', factsLimit, cursor ?? '', limit] as const,
|
||||
filings: (ticker: string | null, limit: number) => ['filings', ticker ?? '', limit] as const,
|
||||
report: (accessionNumber: string) => ['report', accessionNumber] as const,
|
||||
watchlist: () => ['watchlist'] as const,
|
||||
|
||||
@@ -15,8 +15,7 @@ import {
|
||||
import { queryKeys } from '@/lib/query/keys';
|
||||
import type {
|
||||
FinancialHistoryWindow,
|
||||
FinancialStatementKind,
|
||||
FinancialStatementMode
|
||||
FinancialStatementKind
|
||||
} from '@/lib/types';
|
||||
|
||||
export function companyAnalysisQueryOptions(ticker: string) {
|
||||
@@ -31,34 +30,43 @@ export function companyAnalysisQueryOptions(ticker: string) {
|
||||
|
||||
export function companyFinancialStatementsQueryOptions(input: {
|
||||
ticker: string;
|
||||
mode: FinancialStatementMode;
|
||||
statement: FinancialStatementKind;
|
||||
window: FinancialHistoryWindow;
|
||||
includeDimensions?: boolean;
|
||||
includeFacts?: boolean;
|
||||
factsCursor?: string | null;
|
||||
factsLimit?: number;
|
||||
cursor?: string | null;
|
||||
limit?: number;
|
||||
}) {
|
||||
const normalizedTicker = input.ticker.trim().toUpperCase();
|
||||
const includeDimensions = input.includeDimensions ?? false;
|
||||
const includeFacts = input.includeFacts ?? false;
|
||||
const factsCursor = input.factsCursor ?? null;
|
||||
const factsLimit = input.factsLimit ?? 500;
|
||||
const cursor = input.cursor ?? null;
|
||||
const limit = input.limit ?? 40;
|
||||
|
||||
return queryOptions({
|
||||
queryKey: queryKeys.companyFinancialStatements(
|
||||
normalizedTicker,
|
||||
input.mode,
|
||||
input.statement,
|
||||
input.window,
|
||||
includeDimensions,
|
||||
includeFacts,
|
||||
factsCursor,
|
||||
factsLimit,
|
||||
cursor,
|
||||
limit
|
||||
),
|
||||
queryFn: () => getCompanyFinancialStatements({
|
||||
ticker: normalizedTicker,
|
||||
mode: input.mode,
|
||||
statement: input.statement,
|
||||
window: input.window,
|
||||
includeDimensions,
|
||||
includeFacts,
|
||||
factsCursor,
|
||||
factsLimit,
|
||||
cursor,
|
||||
limit
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user