From e00d933c8432086b89df26cb2f7e81d6baa02f46 Mon Sep 17 00:00:00 2001 From: Matthew Russell Date: Sat, 13 Jan 2024 16:21:57 -0500 Subject: [PATCH] chore: fix ts errors in candles-chart --- .../candles-chart/src/lib/data-source.spec.ts | 201 +++++++++--------- 1 file changed, 101 insertions(+), 100 deletions(-) diff --git a/libs/candles-chart/src/lib/data-source.spec.ts b/libs/candles-chart/src/lib/data-source.spec.ts index 50cc226b0..0589799ff 100644 --- a/libs/candles-chart/src/lib/data-source.spec.ts +++ b/libs/candles-chart/src/lib/data-source.spec.ts @@ -21,106 +21,107 @@ const returnDataMocks = (nodes: CandleFieldsFragment[]): CandlesQuery => { } as CandlesQuery; }; -const dataMocks: { [key in Schema.Interval]: Partial[] } = - { - [Schema.Interval.INTERVAL_I1M]: [ - { - __typename: 'Candle', - periodStart: '2023-05-10T12:00:00Z', - lastUpdateInPeriod: '', - close: '10', - volume: '1', - }, - { - __typename: 'Candle', - periodStart: '2023-05-10T12:05:00Z', - lastUpdateInPeriod: '', - close: '5', - volume: '2', - }, - ], - [Schema.Interval.INTERVAL_I5M]: [ - { - __typename: 'Candle', - periodStart: '2023-05-10T12:00:00Z', - lastUpdateInPeriod: '', - close: '10', - volume: '1', - }, - { - __typename: 'Candle', - periodStart: '2023-05-10T12:25:00Z', - lastUpdateInPeriod: '', - close: '5', - volume: '2', - }, - ], - [Schema.Interval.INTERVAL_I15M]: [ - { - __typename: 'Candle', - periodStart: '2023-05-10T12:00:00Z', - lastUpdateInPeriod: '', - close: '10', - volume: '1', - }, - { - __typename: 'Candle', - periodStart: '2023-05-10T13:15:00Z', - lastUpdateInPeriod: '', - close: '5', - volume: '2', - }, - ], - [Schema.Interval.INTERVAL_I1H]: [ - { - __typename: 'Candle', - periodStart: '2023-05-10T12:00:00Z', - lastUpdateInPeriod: '', - close: '10', - volume: '1', - }, - { - __typename: 'Candle', - periodStart: '2023-05-10T17:00:00Z', - lastUpdateInPeriod: '', - close: '5', - volume: '2', - }, - ], - [Schema.Interval.INTERVAL_I6H]: [ - { - __typename: 'Candle', - periodStart: '2023-05-10T12:00:00Z', - lastUpdateInPeriod: '', - close: '10', - volume: '1', - }, - { - __typename: 'Candle', - periodStart: '2023-05-11T18:00:00Z', - lastUpdateInPeriod: '', - close: '5', - volume: '2', - }, - ], - [Schema.Interval.INTERVAL_I1D]: [ - { - __typename: 'Candle', - periodStart: '2023-05-10T00:00:00Z', - lastUpdateInPeriod: '', - close: '10', - volume: '1', - }, - { - __typename: 'Candle', - periodStart: '2023-05-15T00:00:00Z', - lastUpdateInPeriod: '', - close: '5', - volume: '2', - }, - ], - [Schema.Interval.INTERVAL_BLOCK]: [], - }; +const dataMocks: { + [key in Schema.Interval]?: Partial[]; +} = { + [Schema.Interval.INTERVAL_I1M]: [ + { + __typename: 'Candle', + periodStart: '2023-05-10T12:00:00Z', + lastUpdateInPeriod: '', + close: '10', + volume: '1', + }, + { + __typename: 'Candle', + periodStart: '2023-05-10T12:05:00Z', + lastUpdateInPeriod: '', + close: '5', + volume: '2', + }, + ], + [Schema.Interval.INTERVAL_I5M]: [ + { + __typename: 'Candle', + periodStart: '2023-05-10T12:00:00Z', + lastUpdateInPeriod: '', + close: '10', + volume: '1', + }, + { + __typename: 'Candle', + periodStart: '2023-05-10T12:25:00Z', + lastUpdateInPeriod: '', + close: '5', + volume: '2', + }, + ], + [Schema.Interval.INTERVAL_I15M]: [ + { + __typename: 'Candle', + periodStart: '2023-05-10T12:00:00Z', + lastUpdateInPeriod: '', + close: '10', + volume: '1', + }, + { + __typename: 'Candle', + periodStart: '2023-05-10T13:15:00Z', + lastUpdateInPeriod: '', + close: '5', + volume: '2', + }, + ], + [Schema.Interval.INTERVAL_I1H]: [ + { + __typename: 'Candle', + periodStart: '2023-05-10T12:00:00Z', + lastUpdateInPeriod: '', + close: '10', + volume: '1', + }, + { + __typename: 'Candle', + periodStart: '2023-05-10T17:00:00Z', + lastUpdateInPeriod: '', + close: '5', + volume: '2', + }, + ], + [Schema.Interval.INTERVAL_I6H]: [ + { + __typename: 'Candle', + periodStart: '2023-05-10T12:00:00Z', + lastUpdateInPeriod: '', + close: '10', + volume: '1', + }, + { + __typename: 'Candle', + periodStart: '2023-05-11T18:00:00Z', + lastUpdateInPeriod: '', + close: '5', + volume: '2', + }, + ], + [Schema.Interval.INTERVAL_I1D]: [ + { + __typename: 'Candle', + periodStart: '2023-05-10T00:00:00Z', + lastUpdateInPeriod: '', + close: '10', + volume: '1', + }, + { + __typename: 'Candle', + periodStart: '2023-05-15T00:00:00Z', + lastUpdateInPeriod: '', + close: '5', + volume: '2', + }, + ], + [Schema.Interval.INTERVAL_BLOCK]: [], +}; describe('VegaDataSource', () => { const marketId = 'marketId';