Update @testing-library/user-event to the latest version (#11766)
This commit is contained in:
Родитель
f7d22875f7
Коммит
03e70d862a
|
@ -259,7 +259,7 @@
|
|||
"@emotion/core": "^11.0.0",
|
||||
"@testing-library/jest-dom": "^5.16.2",
|
||||
"@testing-library/react": "^13.3.0",
|
||||
"@testing-library/user-event": "^13.5.0",
|
||||
"@testing-library/user-event": "^14.2.6",
|
||||
"autoprefixer": "^10.2.4",
|
||||
"babel-gettext-extractor": "^4.1.3",
|
||||
"babel-loader": "^8.0.4",
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import * as React from 'react';
|
||||
import { createEvent, fireEvent, waitFor } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import defaultUserEvent, {
|
||||
PointerEventsCheckLevel,
|
||||
} from '@testing-library/user-event';
|
||||
|
||||
import {
|
||||
SAVED_RATING,
|
||||
|
@ -48,6 +50,7 @@ import {
|
|||
describe(__filename, () => {
|
||||
let i18n;
|
||||
let store;
|
||||
let userEvent;
|
||||
|
||||
// This is a review with only a rating, no text.
|
||||
const fakeRatingOnly = Object.freeze({
|
||||
|
@ -59,6 +62,12 @@ describe(__filename, () => {
|
|||
beforeEach(() => {
|
||||
i18n = fakeI18n();
|
||||
store = dispatchClientMetadata().store;
|
||||
userEvent = defaultUserEvent.setup({
|
||||
delay: null,
|
||||
// This is needed for one test which was triggering a library error about
|
||||
// pointer events not being available.
|
||||
pointerEventsCheck: PointerEventsCheckLevel.Never,
|
||||
});
|
||||
});
|
||||
|
||||
const render = ({
|
||||
|
@ -1411,8 +1420,6 @@ describe(__filename, () => {
|
|||
screen.getByRole('button', {
|
||||
name: 'This is a bug report or support request',
|
||||
}),
|
||||
undefined,
|
||||
{ skipPointerEventsCheck: true },
|
||||
);
|
||||
|
||||
expect(
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as React from 'react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import defaultUserEvent from '@testing-library/user-event';
|
||||
|
||||
import AutoSearchInput, {
|
||||
SEARCH_TERM_MIN_LENGTH,
|
||||
|
@ -31,11 +31,13 @@ import {
|
|||
|
||||
describe(__filename, () => {
|
||||
let store;
|
||||
let userEvent;
|
||||
const defaultInputName = 'query';
|
||||
const errorHandlerId = `src/amo/components/AutoSearchInput/index.js-${defaultInputName}`;
|
||||
|
||||
beforeEach(() => {
|
||||
store = dispatchClientMetadata().store;
|
||||
userEvent = defaultUserEvent.setup({ delay: null });
|
||||
});
|
||||
|
||||
const render = ({
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import config from 'config';
|
||||
import * as React from 'react';
|
||||
import { createEvent, fireEvent, waitFor } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import defaultUserEvent from '@testing-library/user-event';
|
||||
|
||||
import { setViewContext } from 'amo/actions/viewContext';
|
||||
import { logOutFromServer } from 'amo/api';
|
||||
|
@ -67,6 +67,7 @@ jest.mock('amo/api', () => ({
|
|||
describe(__filename, () => {
|
||||
let history;
|
||||
let store;
|
||||
let userEvent;
|
||||
|
||||
const savedLocation = window.location;
|
||||
|
||||
|
@ -78,6 +79,7 @@ describe(__filename, () => {
|
|||
beforeEach(() => {
|
||||
store = dispatchClientMetadata().store;
|
||||
delete window.location;
|
||||
userEvent = defaultUserEvent.setup({ delay: null });
|
||||
});
|
||||
|
||||
// We need to mock window.matchMedia or the code for the dropdown menu
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import * as React from 'react';
|
||||
import { createEvent, fireEvent } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import defaultUserEvent from '@testing-library/user-event';
|
||||
|
||||
import {
|
||||
ADDON_TYPE_DICT,
|
||||
|
@ -59,6 +59,7 @@ jest.mock('amo/constants', () => ({
|
|||
|
||||
describe(__filename, () => {
|
||||
let store;
|
||||
let userEvent;
|
||||
const defaultAddonName = 'My Add-On';
|
||||
const defaultAddonId = 123;
|
||||
const defaultUserId = 456;
|
||||
|
@ -66,6 +67,7 @@ describe(__filename, () => {
|
|||
|
||||
beforeEach(() => {
|
||||
store = dispatchClientMetadata().store;
|
||||
userEvent = defaultUserEvent.setup({ delay: null });
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
|
10
yarn.lock
10
yarn.lock
|
@ -1813,12 +1813,10 @@
|
|||
"@testing-library/dom" "^8.5.0"
|
||||
"@types/react-dom" "^18.0.0"
|
||||
|
||||
"@testing-library/user-event@^13.5.0":
|
||||
version "13.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-13.5.0.tgz#69d77007f1e124d55314a2b73fd204b333b13295"
|
||||
integrity sha512-5Kwtbo3Y/NowpkbRuSepbyMFkZmHgD+vPzYB/RJ4oxt5Gj/avFFBYjhw27cqSVPVw/3a67NK1PbiIr9k4Gwmdg==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.12.5"
|
||||
"@testing-library/user-event@^14.2.6":
|
||||
version "14.3.0"
|
||||
resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-14.3.0.tgz#0a6750b94b40e4739706d41e8efc2ccf64d2aad9"
|
||||
integrity sha512-P02xtBBa8yMaLhK8CzJCIns8rqwnF6FxhR9zs810flHOBXUYCFjLd8Io1rQrAkQRWEmW2PGdZIEdMxf/KLsqFA==
|
||||
|
||||
"@tootallnate/once@1":
|
||||
version "1.1.2"
|
||||
|
|
Загрузка…
Ссылка в новой задаче