Skip to content

Commit 26b1889

Browse files
committed
feat(core): update peerdependencies
1 parent f0802c0 commit 26b1889

File tree

13 files changed

+46
-51
lines changed

13 files changed

+46
-51
lines changed

src/charts/customBackgroundChart/__tests__/accessibility.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ describe('accessibility utils', () => {
3434

3535
describe('formatValue', () => {
3636
it('formats numbers with locale separators', () => {
37-
expect(formatValue(1234567)).toBe('1,234,567');
37+
const result = formatValue(1234567);
38+
// Accept both English (1,234,567) and Spanish (1.234.567) locale formats
39+
expect(result).toMatch(/^1[,.]234[,.]567$/);
3840
});
3941

4042
it('returns strings as-is', () => {

src/charts/customBackgroundChart/__tests__/customBackgroundChart.test.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ describe('CustomBackgroundChart', () => {
141141
false
142142
);
143143

144-
expect(screen.getByLabelText('Spain: 1,250,000 EUR')).toBeInTheDocument();
144+
// Accept both English (1,250,000) and Spanish (1.250.000) locale formats
145+
const element = screen.getByRole('button', { name: /Spain: 1[,.]250[,.]000 EUR/ });
146+
expect(element).toBeInTheDocument();
145147
});
146148

147149
it('supports custom ariaLabel template', () => {

src/charts/lineChart/hook/__tests__/useHover.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { act, renderHook } from '@testing-library/react-hooks';
1+
import { act, renderHook } from '@testing-library/react';
22

33
import { useHover } from '../useHover';
44

src/charts/lineChart/hook/__tests__/useIndicator.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { act, renderHook } from '@testing-library/react-hooks';
1+
import { act, renderHook } from '@testing-library/react';
22

33
import { useIndicator } from '../useIndicator';
44

src/components/bar/__tests__/bar.test.tsx

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,17 @@ describe('Bar Component', () => {
3737
const paths = screen.getAllByTestId('path');
3838
expect(paths).toHaveLength(mockBarConfig.singleConfig.length);
3939

40-
mockBarConfig.singleConfig.forEach(segment => {
41-
expect(Path).toHaveBeenCalledWith(
42-
expect.objectContaining({
40+
const calls = vi.mocked(Path).mock.calls;
41+
mockBarConfig.singleConfig.forEach((segment, index) => {
42+
const call = calls.find(c => c[0]?.fill === segment.color && c[0]?.title === segment.title);
43+
expect(call).toBeDefined();
44+
if (call) {
45+
expect(call[0]).toMatchObject({
4346
d: expect.any(String),
4447
fill: segment.color,
4548
title: segment.title,
46-
}),
47-
expect.anything()
48-
);
49+
});
50+
}
4951
});
5052
});
5153

@@ -56,12 +58,10 @@ describe('Bar Component', () => {
5658
expect(paths).toHaveLength(mockBarConfig.singleConfig.length);
5759

5860
// Verifica que los segmentos se calculen correctamente
59-
expect(Path).toHaveBeenCalledWith(
60-
expect.objectContaining({
61-
d: expect.any(String),
62-
}),
63-
expect.anything()
64-
);
61+
const calls = vi.mocked(Path).mock.calls;
62+
expect(calls.length).toBeGreaterThan(0);
63+
expect(calls[0][0]).toHaveProperty('d');
64+
expect(typeof calls[0][0].d).toBe('string');
6565
});
6666

6767
it('should calculate correctly the segments for vertical orientation', () => {
@@ -71,12 +71,10 @@ describe('Bar Component', () => {
7171
expect(paths).toHaveLength(mockBarConfig.singleConfig.length);
7272

7373
// Verifica que los segmentos se calculen correctamente
74-
expect(Path).toHaveBeenCalledWith(
75-
expect.objectContaining({
76-
d: expect.any(String),
77-
}),
78-
expect.anything()
79-
);
74+
const calls = vi.mocked(Path).mock.calls;
75+
expect(calls.length).toBeGreaterThan(0);
76+
expect(calls[0][0]).toHaveProperty('d');
77+
expect(typeof calls[0][0].d).toBe('string');
8078
});
8179

8280
it('should handler correctly the round borders', () => {
@@ -85,21 +83,14 @@ describe('Bar Component', () => {
8583
const paths = screen.getAllByTestId('path');
8684
expect(paths).toHaveLength(mockBarConfig.singleConfig.length);
8785

88-
// Verify that the first segment has`startRounded`
89-
expect(Path).toHaveBeenCalledWith(
90-
expect.objectContaining({
91-
d: expect.any(String),
92-
}),
93-
expect.anything()
94-
);
95-
96-
// Verify that the last segment has `endRounded`
97-
expect(Path).toHaveBeenCalledWith(
98-
expect.objectContaining({
99-
d: expect.any(String),
100-
}),
101-
expect.anything()
102-
);
86+
// Verify that segments were rendered with path data
87+
const calls = vi.mocked(Path).mock.calls;
88+
expect(calls.length).toBeGreaterThan(0);
89+
// Verify all calls have valid path data
90+
calls.forEach(call => {
91+
expect(call[0]).toHaveProperty('d');
92+
expect(typeof call[0].d).toBe('string');
93+
});
10394
});
10495

10596
it('should handler correctly a empty barConfig', () => {

src/components/zoomArea/hooks/__tests__/useDragInteraction.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { act } from '@testing-library/react';
2-
import { renderHook } from '@testing-library/react-hooks';
1+
import { act, renderHook } from '@testing-library/react';
32

43
import { ZoomAreaElements } from '../../zoomArea.type';
54
import { useDragInteraction } from '../useDragInteraction';

src/components/zoomArea/hooks/__tests__/useKeyboardNavigation.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { renderHook } from '@testing-library/react-hooks';
1+
import { renderHook } from '@testing-library/react';
22

33
import { ZoomAreaElements } from '../../zoomArea.type';
44
import { useKeyboardNavigation } from '../useKeyboardNavigation';

src/components/zoomArea/hooks/__tests__/useZoomAreaFocus.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { act } from '@testing-library/react';
2-
import { renderHook } from '@testing-library/react-hooks';
1+
import { act, renderHook } from '@testing-library/react';
32

43
import { ZoomAreaElements } from '../../zoomArea.type';
54
import { useZoomAreaFocus } from '../useZoomAreaFocus';

src/components/zoomArea/hooks/__tests__/useZoomData.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { act } from '@testing-library/react';
2-
import { renderHook } from '@testing-library/react-hooks';
1+
import { act, renderHook } from '@testing-library/react';
32

43
import { useZoomData } from '../useZoomData';
54

src/hooks/useFocus/__tests__/useFocus.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { act, renderHook } from '@testing-library/react-hooks';
1+
import { act, renderHook } from '@testing-library/react';
22
import type { FocusEvent } from 'react';
33

44
import { useFocus } from '../useFocus';

0 commit comments

Comments
 (0)