From b5da68ac9afde57f4344b9c2b5fab422255805b2 Mon Sep 17 00:00:00 2001 From: Alejandro Lembke Barrientos Date: Wed, 26 Mar 2025 04:53:59 +0000 Subject: [PATCH] PR-923441: Making fixes. --- cypress/support/component.ts | 2 +- package-lock.json | 27 +++++++++++++++++++++++++++ package.json | 1 + setupTest.ts | 4 ++++ 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/cypress/support/component.ts b/cypress/support/component.ts index 00ae19b..2b08de8 100644 --- a/cypress/support/component.ts +++ b/cypress/support/component.ts @@ -22,7 +22,7 @@ import './commands'; // Alternatively you can use CommonJS syntax: // require('./commands') -import { mount } from 'cypress/react18'; +import { mount } from '@cypress/react' // Augment the Cypress namespace to include type definitions for // your custom command. diff --git a/package-lock.json b/package-lock.json index bcbcb40..610748f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,6 +45,7 @@ "@babel/preset-env": "^7.26.9", "@babel/preset-react": "^7.26.3", "@babel/preset-typescript": "^7.27.0", + "@cypress/react": "^9.0.1", "@eslint/js": "^9.23.0", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.15", "@redux-devtools/extension": "^3.3.0", @@ -2012,6 +2013,25 @@ "node": ">=0.1.90" } }, + "node_modules/@cypress/react": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@cypress/react/-/react-9.0.1.tgz", + "integrity": "sha512-qu6ziP2smdlfy3Yvrhm6PadxEtkc/cl6YhZu3h6KCtz+0s54joqxp6uGYOglpwyMBp3qjtSil1JVlFX0hUi5LQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^18 || ^19", + "@types/react-dom": "^18 || ^19", + "cypress": "*", + "react": "^18 || ^19", + "react-dom": "^18 || ^19" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/@cypress/request": { "version": "3.0.8", "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.8.tgz", @@ -20238,6 +20258,13 @@ "dev": true, "optional": true }, + "@cypress/react": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@cypress/react/-/react-9.0.1.tgz", + "integrity": "sha512-qu6ziP2smdlfy3Yvrhm6PadxEtkc/cl6YhZu3h6KCtz+0s54joqxp6uGYOglpwyMBp3qjtSil1JVlFX0hUi5LQ==", + "dev": true, + "requires": {} + }, "@cypress/request": { "version": "3.0.8", "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.8.tgz", diff --git a/package.json b/package.json index b852e39..47274e9 100644 --- a/package.json +++ b/package.json @@ -69,6 +69,7 @@ "@babel/preset-env": "^7.26.9", "@babel/preset-react": "^7.26.3", "@babel/preset-typescript": "^7.27.0", + "@cypress/react": "^9.0.1", "@eslint/js": "^9.23.0", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.15", "@redux-devtools/extension": "^3.3.0", diff --git a/setupTest.ts b/setupTest.ts index 21f0c55..b646c44 100644 --- a/setupTest.ts +++ b/setupTest.ts @@ -3,6 +3,7 @@ // expect(element).toHaveTextContent(/react/i) // learn more: https://github.com/testing-library/jest-dom import '@testing-library/jest-dom'; +import { TextEncoder, TextDecoder } from 'util'; //import fetch Mock import fetchMock from 'jest-fetch-mock'; @@ -18,3 +19,6 @@ function() { removeListener: () => {/**/} }; }; + +global.TextEncoder = TextEncoder; +global.TextDecoder = TextDecoder as typeof global.TextDecoder;