Migrate tests for Login to Testing Library and convert showNotification to a thunk (#26848)

* Migrate tests for Login to Testing Library

* Convert showNotification to a thunk
Этот коммит содержится в:
Harrison Healey
2024-04-25 17:24:03 -04:00
коммит произвёл GitHub
родитель 60c15c821f
Коммит 80e67ace86
7 изменённых файлов: 331 добавлений и 393 удалений

Просмотреть файл

@@ -3,6 +3,7 @@
import {render} from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import type {History} from 'history';
import {createBrowserHistory} from 'history';
import React from 'react';
import {IntlProvider} from 'react-intl';
@@ -28,6 +29,7 @@ export type FullContextOptions = {
locale?: string;
useMockedStore?: boolean;
pluginReducers?: string[];
history?: History<unknown>;
}
export const renderWithContext = (
@@ -46,7 +48,7 @@ export const renderWithContext = (
// Store these in an object so that they can be maintained through rerenders
const renderState = {
component,
history: createBrowserHistory(),
history: partialOptions?.history ?? createBrowserHistory(),
options,
store: testStore,
};