Re-export all React Testing Library functions (#23522)

Этот коммит содержится в:
Harrison Healey
2023-06-05 12:49:31 -04:00
коммит произвёл GitHub
родитель f4f420dd93
Коммит 9c656c25d9
96 изменённых файлов: 282 добавлений и 322 удалений

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

@@ -1,7 +1,6 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {screen} from '@testing-library/react';
import React from 'react';
import {FormattedMessage, useIntl} from 'react-intl';
import {connect, useSelector} from 'react-redux';
@@ -14,7 +13,7 @@ import {GlobalState} from 'types/store';
import {TestHelper} from 'utils/test_helper';
import {renderWithFullContext} from './react_testing_utils';
import {renderWithFullContext, screen} from './react_testing_utils';
describe('renderWithFullContext', () => {
test('should be able to render anything', () => {

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

@@ -2,6 +2,7 @@
// See LICENSE.txt for license information.
import {render} from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import {createBrowserHistory} from 'history';
import React from 'react';
import {IntlProvider} from 'react-intl';
@@ -10,12 +11,16 @@ import {Router} from 'react-router-dom';
import {DeepPartial} from '@mattermost/types/utilities';
import mergeObjects from 'packages/mattermost-redux/test/merge_objects';
import configureStore from 'store';
import mockStore from 'tests/test_store';
import {GlobalState} from 'types/store';
import mergeObjects from 'packages/mattermost-redux/test/merge_objects';
export * from '@testing-library/react';
export {userEvent};
export const renderWithIntl = (component: React.ReactNode | React.ReactNodeArray, locale = 'en') => {
return render(<IntlProvider locale={locale}>{component}</IntlProvider>);