From 42fe6a46a4579d1df89d4eb2b4303823ec10d9f4 Mon Sep 17 00:00:00 2001 From: jmfrancois Date: Tue, 24 Oct 2023 11:47:07 +0200 Subject: [PATCH] chore: try something --- packages/a11y/package.json | 3 ++- packages/a11y/src/Gesture/withCalendarGesture.test.tsx | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/a11y/package.json b/packages/a11y/package.json index 411830b5a9..938206bf85 100644 --- a/packages/a11y/package.json +++ b/packages/a11y/package.json @@ -7,7 +7,7 @@ "types": "./lib/index.d.ts", "scripts": { "build:lib": "talend-scripts build", - "test": "talend-scripts test ./src", + "test": "talend-scripts test", "lint": "talend-scripts lint" }, "keywords": [ @@ -30,6 +30,7 @@ }, "devDependencies": { "@talend/scripts-core": "^16.0.0", + "@testing-library/user-event": "^14.5.1", "@testing-library/react": "^14.0.0", "react": "^18.2.0", "react-dom": "^18.2.0" diff --git a/packages/a11y/src/Gesture/withCalendarGesture.test.tsx b/packages/a11y/src/Gesture/withCalendarGesture.test.tsx index b87448b43b..a0d6d3718f 100644 --- a/packages/a11y/src/Gesture/withCalendarGesture.test.tsx +++ b/packages/a11y/src/Gesture/withCalendarGesture.test.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { render, screen } from '@testing-library/react'; -import userEvent from '@testing-library/user-event'; +import userEventLib from '@testing-library/user-event'; import { withCalendarGesture } from './withCalendarGesture'; import DayCalendar from '../__mocks__/day-calendar'; import { CalendarGestureProps } from './propTypes'; @@ -71,14 +71,19 @@ describe('withCalendarGesture', () => { goToPreviousMonth: jest.fn(), goToNextMonth: jest.fn(), }; + let userEvent: any; + beforeEach(() => { + userEvent = userEventLib.setup(); jest.clearAllMocks(); }); + describe('LEFT keydown', () => { it('should focus on previous day in same week', async () => { // given render(); // when + await userEvent.click(screen.getByTestId('12')); expect(screen.getByTestId('12')).toHaveFocus();