When a learner tries to load the B2C course page for a course that starts in the future (error_code="course_not_started"), normally the learning MFE automatically redirects to the B2C dashboard. This change supports an alternate error_code "course_not_started_enterprise_learner" to trigger an alternative redirect to the B2B (enterprise) learner dashboard. This does two main things: 1. When the course metadata API response indicates course_access.error_code = "course_not_started_enterprise_learner" then redirect to "/redirect/enterprise-learner-dashboard". 2. When the top-level router matches path "/redirect/enterprise-learner-dashboard" then redirec to to the value of config `ENTERPRISE_LEARNER_PORTAL_URL`. ENT-8078
22 lines
662 B
JavaScript
22 lines
662 B
JavaScript
const { createConfig } = require('@edx/frontend-build');
|
|
|
|
module.exports = createConfig('jest', {
|
|
setupFilesAfterEnv: [
|
|
'<rootDir>/src/setupTest.js',
|
|
],
|
|
coveragePathIgnorePatterns: [
|
|
'src/setupTest.js',
|
|
'src/i18n',
|
|
'src/.*\\.exp\\..*',
|
|
],
|
|
// see https://github.com/axios/axios/issues/5026
|
|
moduleNameMapper: {
|
|
"^axios$": "axios/dist/axios.js",
|
|
// See https://stackoverflow.com/questions/72382316/jest-encountered-an-unexpected-token-react-markdown
|
|
'react-markdown': '<rootDir>/node_modules/react-markdown/react-markdown.min.js',
|
|
},
|
|
testTimeout: 30000,
|
|
testEnvironment: 'jsdom',
|
|
globalSetup: "./global-setup.js"
|
|
});
|