feat: add query params to the payload (#602)

This commit is contained in:
Zainab Amir
2022-07-19 23:01:08 -07:00
committed by GitHub
parent 13d67eb2a3
commit 1ee501f8b9
2 changed files with 8 additions and 0 deletions

View File

@@ -242,6 +242,9 @@ class RegistrationPage extends React.Component {
payload = snakeCaseObject(payload);
payload.totalRegistrationTime = totalRegistrationTime;
// add query params to the payload
payload = { ...payload, ...this.queryParams };
this.setState({
totalRegistrationTime,
}, () => {

View File

@@ -85,6 +85,7 @@ describe('RegistrationPage', () => {
handleInstitutionLogin: jest.fn(),
institutionLogin: false,
};
window.location = { search: '' };
});
afterEach(() => {
@@ -128,6 +129,9 @@ describe('RegistrationPage', () => {
it('should submit form for valid input', () => {
jest.spyOn(global.Date, 'now').mockImplementation(() => 0);
delete window.location;
window.location = { href: getConfig().BASE_URL, search: '?next=/course/demo-course-url' };
const payload = {
name: 'John Doe',
username: 'john_doe',
@@ -137,6 +141,7 @@ describe('RegistrationPage', () => {
honor_code: true,
totalRegistrationTime: 0,
is_authn_mfe: true,
next: '/course/demo-course-url',
};
store.dispatch = jest.fn(store.dispatch);