Run component tests with a real store and use renderWithContext everywhere (#25217)

* Change renderWithFullContext to not mock Redux store

* Remove renderWithIntl and renderWithIntlAndStore

* Rename renderWithFullContext to renderWithContext

* Use renderWithContext for WS context
Этот коммит содержится в:
Harrison Healey
2023-11-08 17:02:40 -05:00
коммит произвёл GitHub
родитель ab349946db
Коммит be34a5d2df
82 изменённых файлов: 1355 добавлений и 1421 удалений

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

@@ -3,7 +3,6 @@
import {shallow} from 'enzyme';
import React from 'react';
import {Router} from 'react-router-dom';
import type {Bot} from '@mattermost/types/bots';
import type {IncomingWebhook, OAuthApp, OutgoingWebhook} from '@mattermost/types/integrations';
@@ -11,8 +10,7 @@ import type {IDMappedObjects} from '@mattermost/types/utilities';
import ConfirmIntegration from 'components/integrations/confirm_integration/confirm_integration';
import {renderWithIntlAndStore} from 'tests/react_testing_utils';
import {getHistory} from 'utils/browser_history';
import {renderWithContext} from 'tests/react_testing_utils';
import {TestHelper} from 'utils/test_helper';
describe('components/integrations/ConfirmIntegration', () => {
@@ -76,10 +74,8 @@ describe('components/integrations/ConfirmIntegration', () => {
test('should match callback URLs of OAuth Apps', () => {
props.location.search = getSearchString('oauth2-apps');
const {container} = renderWithIntlAndStore(
<Router history={getHistory()}>
<ConfirmIntegration {...props}/>
</Router>,
const {container} = renderWithContext(
<ConfirmIntegration {...props}/>,
initialState,
);