Use vitest/browser user events instead of testing library ones

This commit is contained in:
Alejandro Celaya
2026-08-14 10:12:43 +02:00
parent baa324dc6f
commit 7c0b9101ec
6 changed files with 4 additions and 25 deletions

21
package-lock.json generated
View File

@@ -42,7 +42,6 @@
"@tailwindcss/vite": "^4.3.3", "@tailwindcss/vite": "^4.3.3",
"@testing-library/jest-dom": "^7.0.0", "@testing-library/jest-dom": "^7.0.0",
"@testing-library/react": "^16.3.2", "@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.3",
"@total-typescript/shoehorn": "^0.1.2", "@total-typescript/shoehorn": "^0.1.2",
"@types/node": "^26.1.2", "@types/node": "^26.1.2",
"@types/react": "^19.2.18", "@types/react": "^19.2.18",
@@ -3746,19 +3745,6 @@
} }
} }
}, },
"node_modules/@testing-library/user-event": {
"version": "14.6.3",
"resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.6.3.tgz",
"integrity": "sha512-6dBq67jT8lE+JTE8Exm02Kt6ze43hz1jdiSpSJwtTZiT1xQQ6b7nZYTTQ9njdArdU8XklOwaDp/AbT/eYSKF4g==",
"dev": true,
"engines": {
"node": ">=12",
"npm": ">=6"
},
"peerDependencies": {
"@testing-library/dom": ">=7.21.4"
}
},
"node_modules/@total-typescript/shoehorn": { "node_modules/@total-typescript/shoehorn": {
"version": "0.1.2", "version": "0.1.2",
"resolved": "https://registry.npmjs.org/@total-typescript/shoehorn/-/shoehorn-0.1.2.tgz", "resolved": "https://registry.npmjs.org/@total-typescript/shoehorn/-/shoehorn-0.1.2.tgz",
@@ -11480,13 +11466,6 @@
"@babel/runtime": "^7.12.5" "@babel/runtime": "^7.12.5"
} }
}, },
"@testing-library/user-event": {
"version": "14.6.3",
"resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.6.3.tgz",
"integrity": "sha512-6dBq67jT8lE+JTE8Exm02Kt6ze43hz1jdiSpSJwtTZiT1xQQ6b7nZYTTQ9njdArdU8XklOwaDp/AbT/eYSKF4g==",
"dev": true,
"requires": {}
},
"@total-typescript/shoehorn": { "@total-typescript/shoehorn": {
"version": "0.1.2", "version": "0.1.2",
"resolved": "https://registry.npmjs.org/@total-typescript/shoehorn/-/shoehorn-0.1.2.tgz", "resolved": "https://registry.npmjs.org/@total-typescript/shoehorn/-/shoehorn-0.1.2.tgz",

View File

@@ -59,7 +59,6 @@
"@tailwindcss/vite": "^4.3.3", "@tailwindcss/vite": "^4.3.3",
"@testing-library/jest-dom": "^7.0.0", "@testing-library/jest-dom": "^7.0.0",
"@testing-library/react": "^16.3.2", "@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.3",
"@total-typescript/shoehorn": "^0.1.2", "@total-typescript/shoehorn": "^0.1.2",
"@types/node": "^26.1.2", "@types/node": "^26.1.2",
"@types/react": "^19.2.18", "@types/react": "^19.2.18",

View File

@@ -1,10 +1,10 @@
import type { ShlinkApiClient } from '@shlinkio/shlink-js-sdk'; import type { ShlinkApiClient } from '@shlinkio/shlink-js-sdk';
import type { RenderOptions } from '@testing-library/react'; import type { RenderOptions } from '@testing-library/react';
import { render } from '@testing-library/react'; import { render } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { fromPartial } from '@total-typescript/shoehorn'; import { fromPartial } from '@total-typescript/shoehorn';
import type { PropsWithChildren, ReactElement } from 'react'; import type { PropsWithChildren, ReactElement } from 'react';
import { Provider } from 'react-redux'; import { Provider } from 'react-redux';
import { userEvent } from 'vitest/browser';
import { ContainerProvider } from '../../src/container/context'; import { ContainerProvider } from '../../src/container/context';
import type { RootState } from '../../src/store'; import type { RootState } from '../../src/store';
import { setUpStore } from '../../src/store'; import { setUpStore } from '../../src/store';

View File

@@ -1,7 +1,7 @@
import { screen } from '@testing-library/react'; import { screen } from '@testing-library/react';
import type { UserEvent } from '@testing-library/user-event';
import { fromPartial } from '@total-typescript/shoehorn'; import { fromPartial } from '@total-typescript/shoehorn';
import { MemoryRouter } from 'react-router'; import { MemoryRouter } from 'react-router';
import type { UserEvent } from 'vitest/browser';
import type { ServerWithId } from '../../src/servers/data'; import type { ServerWithId } from '../../src/servers/data';
import { ManageServersRowDropdown } from '../../src/servers/ManageServersRowDropdown'; import { ManageServersRowDropdown } from '../../src/servers/ManageServersRowDropdown';
import { checkAccessibility } from '../__helpers__/accessibility'; import { checkAccessibility } from '../__helpers__/accessibility';

View File

@@ -2,6 +2,7 @@
"compilerOptions": { "compilerOptions": {
"allowJs": true, "allowJs": true,
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"allowImportingTsExtensions": true,
"jsx": "react-jsx", "jsx": "react-jsx",
"lib": ["dom", "dom.iterable", "esnext"], "lib": ["dom", "dom.iterable", "esnext"],
"types": ["vite/client", "vitest/globals"], "types": ["vite/client", "vitest/globals"],

View File

@@ -3,7 +3,7 @@ import react from '@vitejs/plugin-react';
import { playwright } from '@vitest/browser-playwright'; import { playwright } from '@vitest/browser-playwright';
import { VitePWA } from 'vite-plugin-pwa'; import { VitePWA } from 'vite-plugin-pwa';
import { defineConfig } from 'vitest/config'; import { defineConfig } from 'vitest/config';
import { manifest } from './manifest'; import { manifest } from './manifest.ts';
import pack from './package.json' with { type: 'json' }; import pack from './package.json' with { type: 'json' };
const homepage = pack.homepage?.trim(); const homepage = pack.homepage?.trim();