test: fix a couple of tests
This commit is contained in:
committed by
Adolfo R. Brandes
parent
8f8531a242
commit
7c8051a440
@@ -37,7 +37,6 @@ const siteConfig: SiteConfig = {
|
||||
PRIVACY_POLICY: null,
|
||||
SEARCH_CATALOG_URL: null,
|
||||
SESSION_COOKIE_DOMAIN: 'local.openedx.io',
|
||||
SHOW_CONFIGURABLE_EDX_FIELDS: false,
|
||||
SHOW_REGISTRATION_LINKS: false,
|
||||
TOS_AND_HONOR_CODE: null,
|
||||
TOS_LINK: null,
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { IntlProvider, mergeSiteConfig } from '@openedx/frontend-base';
|
||||
import { IntlProvider, mergeAppConfig } from '@openedx/frontend-base';
|
||||
import { render } from '@testing-library/react';
|
||||
import { Context as ResponsiveContext } from 'react-responsive';
|
||||
|
||||
import BaseContainer from '../index';
|
||||
import { testAppId } from '../../setupTest';
|
||||
|
||||
const LargeScreen = {
|
||||
wrappingComponent: ResponsiveContext.Provider,
|
||||
@@ -25,10 +26,8 @@ describe('Base component tests', () => {
|
||||
});
|
||||
|
||||
it('renders Image layout when ENABLE_IMAGE_LAYOUT configuration is enabled', () => {
|
||||
mergeSiteConfig({
|
||||
custom: {
|
||||
ENABLE_IMAGE_LAYOUT: true,
|
||||
}
|
||||
mergeAppConfig(testAppId, {
|
||||
ENABLE_IMAGE_LAYOUT: true,
|
||||
});
|
||||
|
||||
const { container } = render(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Provider } from 'react-redux';
|
||||
|
||||
import {
|
||||
configureI18n, injectIntl, IntlProvider, mergeSiteConfig
|
||||
configureI18n, injectIntl, IntlProvider, mergeAppConfig
|
||||
} from '@openedx/frontend-base';
|
||||
import {
|
||||
fireEvent, render, screen,
|
||||
@@ -11,6 +11,7 @@ import configureStore from 'redux-mock-store';
|
||||
|
||||
import { INTERNAL_SERVER_ERROR, LOGIN_PAGE } from '../../data/constants';
|
||||
import { PASSWORD_RESET } from '../../reset-password/data/constants';
|
||||
import { testAppId } from '../../setupTest';
|
||||
import { setForgotPasswordFormData } from '../data/actions';
|
||||
import ForgotPasswordPage from '../ForgotPasswordPage';
|
||||
|
||||
@@ -41,11 +42,9 @@ const initialState = {
|
||||
};
|
||||
|
||||
describe('ForgotPasswordPage', () => {
|
||||
mergeSiteConfig({
|
||||
custom: {
|
||||
LOGIN_ISSUE_SUPPORT_LINK: '',
|
||||
INFO_EMAIL: '',
|
||||
}
|
||||
mergeAppConfig(testAppId, {
|
||||
LOGIN_ISSUE_SUPPORT_LINK: '',
|
||||
INFO_EMAIL: '',
|
||||
});
|
||||
|
||||
let props = {};
|
||||
@@ -81,10 +80,8 @@ describe('ForgotPasswordPage', () => {
|
||||
});
|
||||
|
||||
it('should display need other help signing in button', () => {
|
||||
mergeSiteConfig({
|
||||
custom: {
|
||||
LOGIN_ISSUE_SUPPORT_LINK: '/support',
|
||||
}
|
||||
mergeAppConfig(testAppId, {
|
||||
LOGIN_ISSUE_SUPPORT_LINK: '/support',
|
||||
});
|
||||
render(reduxWrapper(<IntlForgotPasswordPage {...props} />));
|
||||
const forgotPasswordButton = screen.findByText('Need help signing in?');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Provider } from 'react-redux';
|
||||
|
||||
import { injectIntl, IntlProvider, mergeSiteConfig } from '@openedx/frontend-base';
|
||||
import { injectIntl, IntlProvider } from '@openedx/frontend-base';
|
||||
import { fireEvent, render } from '@testing-library/react';
|
||||
import { BrowserRouter as Router } from 'react-router-dom';
|
||||
import configureStore from 'redux-mock-store';
|
||||
@@ -71,12 +71,6 @@ describe('CountryField', () => {
|
||||
});
|
||||
|
||||
describe('Test Country Field', () => {
|
||||
mergeSiteConfig({
|
||||
custom: {
|
||||
SHOW_CONFIGURABLE_EDX_FIELDS: true,
|
||||
}
|
||||
});
|
||||
|
||||
const emptyFieldValidation = {
|
||||
country: 'Select your country or region of residence',
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Provider } from 'react-redux';
|
||||
|
||||
import {
|
||||
configureI18n, getLocale, injectIntl, IntlProvider, mergeSiteConfig
|
||||
configureI18n, getLocale, injectIntl, IntlProvider, mergeAppConfig
|
||||
} from '@openedx/frontend-base';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { BrowserRouter as Router } from 'react-router-dom';
|
||||
@@ -10,6 +10,7 @@ import configureStore from 'redux-mock-store';
|
||||
import {
|
||||
FORBIDDEN_REQUEST, INTERNAL_SERVER_ERROR, TPA_AUTHENTICATION_FAILURE, TPA_SESSION_EXPIRED,
|
||||
} from '../../data/constants';
|
||||
import { testAppId } from '../../../setupTest';
|
||||
import RegistrationPage from '../../RegistrationPage';
|
||||
import RegistrationFailureMessage from '../RegistrationFailure';
|
||||
|
||||
@@ -40,12 +41,10 @@ jest.mock('react-router-dom', () => {
|
||||
});
|
||||
|
||||
describe('RegistrationFailure', () => {
|
||||
mergeSiteConfig({
|
||||
custom: {
|
||||
PRIVACY_POLICY: 'https://privacy-policy.com',
|
||||
TOS_AND_HONOR_CODE: 'https://tos-and-honot-code.com',
|
||||
USER_RETENTION_COOKIE_NAME: 'authn-returning-user',
|
||||
}
|
||||
mergeAppConfig(testAppId, {
|
||||
PRIVACY_POLICY: 'https://privacy-policy.com',
|
||||
TOS_AND_HONOR_CODE: 'https://tos-and-honot-code.com',
|
||||
USER_RETENTION_COOKIE_NAME: 'authn-returning-user',
|
||||
});
|
||||
|
||||
let props = {};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Provider } from 'react-redux';
|
||||
|
||||
import {
|
||||
configureI18n, getSiteConfig, getLocale, injectIntl, IntlProvider, mergeSiteConfig
|
||||
configureI18n, getSiteConfig, getLocale, injectIntl, IntlProvider, mergeAppConfig
|
||||
} from '@openedx/frontend-base';
|
||||
import { fireEvent, render } from '@testing-library/react';
|
||||
import { BrowserRouter as Router } from 'react-router-dom';
|
||||
@@ -10,6 +10,7 @@ import configureStore from 'redux-mock-store';
|
||||
import {
|
||||
COMPLETE_STATE, LOGIN_PAGE, PENDING_STATE, REGISTER_PAGE,
|
||||
} from '../../../data/constants';
|
||||
import { testAppId } from '../../../setupTest';
|
||||
import RegistrationPage from '../../RegistrationPage';
|
||||
|
||||
jest.mock('@openedx/frontend-base', () => ({
|
||||
@@ -39,12 +40,10 @@ jest.mock('react-router-dom', () => {
|
||||
});
|
||||
|
||||
describe('ThirdPartyAuth', () => {
|
||||
mergeSiteConfig({
|
||||
custom: {
|
||||
PRIVACY_POLICY: 'https://privacy-policy.com',
|
||||
TOS_AND_HONOR_CODE: 'https://tos-and-honot-code.com',
|
||||
USER_RETENTION_COOKIE_NAME: 'authn-returning-user',
|
||||
}
|
||||
mergeAppConfig(testAppId, {
|
||||
PRIVACY_POLICY: 'https://privacy-policy.com',
|
||||
TOS_AND_HONOR_CODE: 'https://tos-and-honot-code.com',
|
||||
USER_RETENTION_COOKIE_NAME: 'authn-returning-user',
|
||||
});
|
||||
|
||||
let props = {};
|
||||
@@ -128,11 +127,6 @@ describe('ThirdPartyAuth', () => {
|
||||
};
|
||||
|
||||
describe('Test Third Party Auth', () => {
|
||||
mergeSiteConfig({
|
||||
custom: {
|
||||
SHOW_CONFIGURABLE_EDX_FIELDS: true,
|
||||
}
|
||||
});
|
||||
getLocale.mockImplementation(() => ('en-us'));
|
||||
|
||||
const secondaryProviders = {
|
||||
|
||||
Reference in New Issue
Block a user