Загрузка данных
FAIL src/widgets/Chart/__tests__/useChartPublicContext.test.tsx (62.52 s)
● useChartPublicContext › should pass instrument id and display name when a matching instrument is found
expect(jest.fn()).toHaveBeenCalledWith(...expected)
Expected: "MOEX:TEST2", "Test Instrument 2"
Received: "MOEX:TEST2", "Test Instrument 2", "TEST2"
Number of calls: 1
143 | // Assert
144 | expect(mockSetCurrInstrument).toHaveBeenCalledTimes(1);
> 145 | expect(mockSetCurrInstrument).toHaveBeenCalledWith('MOEX:TEST2', 'Test Instrument 2');
| ^
146 | });
147 |
148 | it('should return undefined when no matching instrument is found', () => {
at Object.<anonymous> (src/widgets/Chart/__tests__/useChartPublicContext.test.tsx:145:35)
● useChartPublicContext › should set current instrument to DEFAULT_SYMBOL with display name when no field value and widget has master
expect(jest.fn()).toHaveBeenCalledWith(...expected)
Expected: "Поиск", "Инструмент по умолчанию"
Received: "Поиск", "Инструмент по умолчанию", "DEFAULT"
Number of calls: 1
217 | // Assert
218 | expect(mockSetCurrInstrument).toHaveBeenCalledTimes(1);
> 219 | expect(mockSetCurrInstrument).toHaveBeenCalledWith(DEFAULT_SYMBOL, 'Инструмент по умолчанию');
| ^
220 | });
221 |
222 | it('should handle case when widget is not found in widgets array', () => {
at Object.<anonymous> (src/widgets/Chart/__tests__/useChartPublicContext.test.tsx:219:35)
● useChartPublicContext › should handle case when widget is not found in widgets array
expect(jest.fn()).toHaveBeenCalledWith(...expected)
Expected: "MOEX:TEST1", "Test Instrument 1"
Received: "MOEX:TEST1", "Test Instrument 1", "TEST1"
Number of calls: 1
249 | // Assert
250 | expect(result.current.issKey).toBe('MOEX:TEST1');
> 251 | expect(mockSetCurrInstrument).toHaveBeenCalledWith('MOEX:TEST1', 'Test Instrument 1');
| ^
252 | });
253 |
254 | it('should handle case when contracts array is empty', () => {
at Object.<anonymous> (src/widgets/Chart/__tests__/useChartPublicContext.test.tsx:251:35)
PASS src/widgets/Chart/__tests__/requestBars.test.ts (62.688 s)
● Console
console.error
error from requestRealTimeBars indicativeQuotesController: Error: API Error
at Object.<anonymous> (C:\Users\ShkinderDV\moex-terminal-front\src\widgets\Chart\__tests__\requestBars.test.ts:570:25)
at Promise.then.completed (C:\Users\ShkinderDV\moex-terminal-front\node_modules\jest-circus\build\utils.js:298:28)
at new Promise (<anonymous>)
at callAsyncCircusFn (C:\Users\ShkinderDV\moex-terminal-front\node_modules\jest-circus\build\utils.js:231:10)
at _callCircusTest (C:\Users\ShkinderDV\moex-terminal-front\node_modules\jest-circus\build\run.js:316:40)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at _runTest (C:\Users\ShkinderDV\moex-terminal-front\node_modules\jest-circus\build\run.js:252:3)
at _runTestsForDescribeBlock (C:\Users\ShkinderDV\moex-terminal-front\node_modules\jest-circus\build\run.js:126:9)
at _runTestsForDescribeBlock (C:\Users\ShkinderDV\moex-terminal-front\node_modules\jest-circus\build\run.js:121:9)
at run (C:\Users\ShkinderDV\moex-terminal-front\node_modules\jest-circus\build\run.js:71:3)
at runAndTransformResultsToJestFormat (C:\Users\ShkinderDV\moex-terminal-front\node_modules\jest-circus\build\legacy-code-todo-rewrite\jestAdapterInit.js:122:21)
at jestAdapter (C:\Users\ShkinderDV\moex-terminal-front\node_modules\jest-circus\build\legacy-code-todo-rewrite\jestAdapter.js:79:19)
at runTestInternal (C:\Users\ShkinderDV\moex-terminal-front\node_modules\jest-runner\build\runTest.js:367:16)
at runTest (C:\Users\ShkinderDV\moex-terminal-front\node_modules\jest-runner\build\runTest.js:444:34)
at Object.worker (C:\Users\ShkinderDV\moex-terminal-front\node_modules\jest-runner\build\testWorker.js:106:12)
161 | return bar;
162 | } catch (error) {
> 163 | console.error('error from requestRealTimeBars indicativeQuotesController: ', error);
| ^
164 |
165 | return undefined;
166 | }
at requestRealtimeBars (src/widgets/Chart/requestBars.ts:163:15)
at Object.<anonymous> (src/widgets/Chart/__tests__/requestBars.test.ts:575:5)
console.error
error from requestRealTimeBars: Error: API Error
at Object.<anonymous> (C:\Users\ShkinderDV\moex-terminal-front\src\widgets\Chart\__tests__\requestBars.test.ts:590:7)
at Promise.then.completed (C:\Users\ShkinderDV\moex-terminal-front\node_modules\jest-circus\build\utils.js:298:28)
at new Promise (<anonymous>)
at callAsyncCircusFn (C:\Users\ShkinderDV\moex-terminal-front\node_modules\jest-circus\build\utils.js:231:10)
at _callCircusTest (C:\Users\ShkinderDV\moex-terminal-front\node_modules\jest-circus\build\run.js:316:40)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at _runTest (C:\Users\ShkinderDV\moex-terminal-front\node_modules\jest-circus\build\run.js:252:3)
at _runTestsForDescribeBlock (C:\Users\ShkinderDV\moex-terminal-front\node_modules\jest-circus\build\run.js:126:9)
at _runTestsForDescribeBlock (C:\Users\ShkinderDV\moex-terminal-front\node_modules\jest-circus\build\run.js:121:9)
at run (C:\Users\ShkinderDV\moex-terminal-front\node_modules\jest-circus\build\run.js:71:3)
at runAndTransformResultsToJestFormat (C:\Users\ShkinderDV\moex-terminal-front\node_modules\jest-circus\build\legacy-code-todo-rewrite\jestAdapterInit.js:122:21)
at jestAdapter (C:\Users\ShkinderDV\moex-terminal-front\node_modules\jest-circus\build\legacy-code-todo-rewrite\jestAdapter.js:79:19)
at runTestInternal (C:\Users\ShkinderDV\moex-terminal-front\node_modules\jest-runner\build\runTest.js:367:16)
at runTest (C:\Users\ShkinderDV\moex-terminal-front\node_modules\jest-runner\build\runTest.js:444:34)
at Object.worker (C:\Users\ShkinderDV\moex-terminal-front\node_modules\jest-runner\build\testWorker.js:106:12)
196 | return bar;
197 | } catch (error) {
> 198 | console.error('error from requestRealTimeBars: ', error);
| ^
199 |
200 | return undefined;
201 | }
at requestRealtimeBars (src/widgets/Chart/requestBars.ts:198:13)
at Object.<anonymous> (src/widgets/Chart/__tests__/requestBars.test.ts:596:5)
FAIL src/widgets/Chart/__tests__/CompareModal.test.tsx
● Test suite failed to run
Automatic publicPath is not supported in this browser
1 | import { act, render } from '@testing-library/react';
2 |
> 3 | import { CompareMode } from 'moex-chart';
| ^
4 | import React from 'react';
5 |
6 | import { InstrumentSearch } from '@components/InstrumentSearch';
at node_modules/moex-chart/dist/index.cjs:2:158236
at node_modules/moex-chart/dist/index.cjs:2:158378
at Object.<anonymous> (node_modules/moex-chart/dist/index.cjs:2:2965698)
at Object.<anonymous> (src/widgets/Chart/__tests__/CompareModal.test.tsx:3:1)
FAIL src/widgets/Chart/__tests__/MoexChart.test.tsx
● Test suite failed to run
Automatic publicPath is not supported in this browser
> 1 | import { MoexChart, Timeframes } from 'moex-chart';
| ^
2 |
3 | import { useEffect, useRef, useState } from 'react';
4 |
at node_modules/moex-chart/dist/index.cjs:2:158236
at node_modules/moex-chart/dist/index.cjs:2:158378
at Object.<anonymous> (node_modules/moex-chart/dist/index.cjs:2:2965698)
at Object.<anonymous> (src/widgets/Chart/components/MoexChart/hooks/useMoexchart.ts:1:1)
at Object.<anonymous> (src/widgets/Chart/components/MoexChart/hooks/index.ts:1:1)
at Object.<anonymous> (src/widgets/Chart/__tests__/MoexChart.test.tsx:7:1)
FAIL src/widgets/Chart/__tests__/useChartComponentFacade.test.tsx
● Test suite failed to run
The slice reducer for key "widgets" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.
39 | const sagaMiddleware = createSagaMiddleware();
40 |
> 41 | const rootReducer = combineReducers({
| ^
42 | coreSlice,
43 | publicContext,
44 | workspaces,
at node_modules/redux/lib/redux.js:481:13
at Array.forEach (<anonymous>)
at assertReducerShape (node_modules/redux/lib/redux.js:474:25)
at combineReducers (node_modules/redux/lib/redux.js:539:5)
at Object.<anonymous> (src/store/setupStore.ts:41:36)
at Object.<anonymous> (src/store/store.ts:8:1)
at Object.<anonymous> (src/widgets/Chart/__tests__/useChartComponentFacade.test.tsx:9:1)
PASS src/widgets/Chart/__tests__/SymbolSearchModal.test.tsx
FAIL src/widgets/Chart/__tests__/dataSourceProvide.test.ts
● DataSourceProvider › should request realtime data and update normalized symbol
expect(jest.fn()).toHaveBeenCalledWith(...expected)
- Expected
+ Received
Object {
- "currencyPair": "MOEX.SBER",
+ "currencyPair": "moex.sber",
"indicativeData": undefined,
"interval": "1",
- "ticker": "MOEX:SBER",
+ "ticker": "moex:sber",
},
Number of calls: 1
247 |
248 | // Assert
> 249 | expect(mockRequestRealtimeBars).toHaveBeenCalledWith({
| ^
250 | currencyPair: 'MOEX.SBER',
251 | interval: '1',
252 | ticker: 'MOEX:SBER',
at Object.<anonymous> (src/widgets/Chart/__tests__/dataSourceProvide.test.ts:249:37)
FAIL src/widgets/Chart/__tests__/useMoexChart.test.tsx (61.263 s)
● useMoexChart › should serialize compare symbol, display name and ticker in snapshot
expect(received).toEqual(expected) // deep equality
- Expected - 1
+ Received + 1
@@ -9,9 +9,9 @@
"priceScaleId": "left",
},
},
],
"symbol": "MOEX:GAZP",
- "symbolTicker": "GAZP",
+ "symbolTicket": "GAZP",
},
"id": "compare-gazp",
}
414 |
415 | // Assert
> 416 | expect(compareIndicator).toEqual({
| ^
417 | id: 'compare-gazp',
418 | config: {
419 | symbol: 'MOEX:GAZP',
at Object.<anonymous> (src/widgets/Chart/__tests__/useMoexchart.test.tsx:416:30)
● useMoexChart › should initialize indicative instrument with id, name and ticker
expect(jest.fn()).toHaveBeenCalledWith(...expected)
Expected: "2xOFZ:INAV", "Индикатив Расчётный", "INAV"
Number of calls: 0
739 | // Assert
740 | expect(mockGetDataSource).toHaveBeenCalledWith(indicativeData, expect.any(Function));
> 741 | expect(mockSetSymbol).toHaveBeenCalledWith('2xOFZ:INAV', 'Индикатив Расчётный', 'INAV');
| ^
742 | });
743 |
744 | it('should pass realtime params to data source provider', () => {
at Object.<anonymous> (src/widgets/Chart/__tests__/useMoexchart.test.tsx:741:27)