Skip to content

Commit 3e76f7a

Browse files
feat: Added support to redirect to DSC if required. (#958)
1 parent 36062ff commit 3e76f7a

File tree

6 files changed

+235
-36
lines changed

6 files changed

+235
-36
lines changed

package-lock.json

Lines changed: 177 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@
4444
"@reduxjs/toolkit": "1.8.1",
4545
"classnames": "2.3.1",
4646
"core-js": "3.22.2",
47+
"history": "^5.3.0",
4748
"js-cookie": "3.0.1",
4849
"lodash.camelcase": "4.3.0",
4950
"prop-types": "15.8.1",
51+
"query-string": "^7.1.1",
5052
"react": "16.14.0",
5153
"react-dom": "16.14.0",
5254
"react-helmet": "6.1.0",

src/courseware/CoursewareContainer.test.jsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ describe('CoursewareContainer', () => {
450450
has_access: false,
451451
error_code: errorCode,
452452
additional_context_user_message: 'uhoh oh no', // only used by audit_expired
453+
developer_message: 'data_sharing_consent_url', // only used by data_sharing_access_required
453454
},
454455
});
455456

@@ -475,6 +476,13 @@ describe('CoursewareContainer', () => {
475476
expect(global.location.href).toEqual(`http://localhost/redirect/survey/${courseMetadata.id}`);
476477
});
477478

479+
it('should go to consent page for a data_sharing_access_required error code', async () => {
480+
setUpWithDeniedStatus('data_sharing_access_required');
481+
await loadContainer();
482+
483+
expect(global.location.href).toEqual('http://localhost/redirect/consent?consentPath=data_sharing_consent_url');
484+
});
485+
478486
it('should go to course home for an authentication_required error code', async () => {
479487
const { courseMetadata } = setUpWithDeniedStatus('authentication_required');
480488
await loadContainer();

0 commit comments

Comments
 (0)