Загрузка данных
PASS src/core/Drawings/__tests__/utils.test.ts
Summary of all failing tests
FAIL src/components/__tests__/Header.test.tsx
● Test suite failed to run
TypeError: (0 , _translations.getLocale) is not a function
58 |
59 | const getPluralRules = (): Intl.PluralRules => {
> 60 | const locale = getLocale();
| ^
61 | const cachedRules = pluralRulesCache.get(locale);
62 |
63 | if (cachedRules) {
at getPluralRules (src/utils/formatTimeframeLabel.ts:60:27)
at getPluralRules (src/utils/formatTimeframeLabel.ts:75:16)
at getUnitTranslationKey (src/utils/formatTimeframeLabel.ts:82:24)
at timeframeOption (src/components/Menu/TimeframesMenu/constants.ts:6:30)
at timeframeOption (src/components/Menu/TimeframesMenu/constants.ts:12:7)
at Object.timeframes (src/components/Menu/TimeframesMenu/constants.ts:54:27)
at Object.require (src/components/Menu/TimeframesMenu/index.tsx:8:1)
at Object.require (src/components/Menu/index.tsx:4:1)
at Object.require (src/components/Header/index.tsx:30:1)
at Object.require (src/components/__tests__/Header.test.tsx:5:1)
FAIL src/core/__tests__/Chart.test.ts
● Chart › copyImage › должен копировать изображение графика вместе с видимыми легендами
TypeError: Cannot redefine property: drawTextLayer
at Function.defineProperty (<anonymous>)
108 | chart.lwcChart.chartElement.mockReturnValue(chartElement);
109 |
> 110 | const drawTextLayer = jest.spyOn(utils, 'drawTextLayer').mockImplementation();
| ^
111 | const canvasToBlob = jest.spyOn(utils, 'canvasToBlob').mockResolvedValue(blob);
112 |
113 | await chart.copyImage();
at ModuleMocker.spyOn (node_modules/jest-environment-jsdom/node_modules/jest-mock/build/index.js:776:16)
at Object.spyOn (src/core/__tests__/Chart.test.ts:110:34)
● Chart › copyImage › не должен дорисовывать скрытые легенды
TypeError: Cannot redefine property: drawTextLayer
at Function.defineProperty (<anonymous>)
140 | chart.lwcChart.chartElement.mockReturnValue(chartElement);
141 |
> 142 | const drawTextLayer = jest.spyOn(utils, 'drawTextLayer').mockImplementation();
| ^
143 |
144 | jest.spyOn(utils, 'canvasToBlob').mockResolvedValue(new Blob(['chart'], { type: 'image/png' }));
145 |
at ModuleMocker.spyOn (node_modules/jest-environment-jsdom/node_modules/jest-mock/build/index.js:776:16)
at Object.spyOn (src/core/__tests__/Chart.test.ts:142:34)
● Chart › copyImage › не должен записывать данные в clipboard, если Blob не удалось создать
TypeError: Cannot redefine property: canvasToBlob
at Function.defineProperty (<anonymous>)
158 | chart.lwcChart.chartElement.mockReturnValue(chartElement);
159 |
> 160 | jest.spyOn(utils, 'canvasToBlob').mockRejectedValue(new Error('Failed to create chart image'));
| ^
161 |
162 | await expect(chart.copyImage()).rejects.toThrow('Failed to create chart image');
163 |
at ModuleMocker.spyOn (node_modules/jest-environment-jsdom/node_modules/jest-mock/build/index.js:776:16)
at Object.spyOn (src/core/__tests__/Chart.test.ts:160:12)
Test Suites: 2 failed, 39 passed, 41 total
Tests: 3 failed, 595 passed, 598 total
Snapshots: 0 total
Time: 63.952 s
Ran all test suites.