From 4a65f0a84c840ad17bf2e9be87fc8d73250a1213 Mon Sep 17 00:00:00 2001 From: Blue Date: Wed, 28 Aug 2024 15:08:30 +0500 Subject: [PATCH] fix: change the totalRegisterationTime to snake case (#1301) Description: Convert the totalRegistrationTime to snake case VAN-1816 Co-authored-by: Ahtesham Quraish --- src/register/RegistrationPage.test.jsx | 14 +++++++------- .../tests/ConfigurableRegistrationForm.test.jsx | 4 ++-- src/register/data/utils.js | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/register/RegistrationPage.test.jsx b/src/register/RegistrationPage.test.jsx index 92c74854..18e4e513 100644 --- a/src/register/RegistrationPage.test.jsx +++ b/src/register/RegistrationPage.test.jsx @@ -183,7 +183,7 @@ describe('RegistrationPage', () => { password: 'password1', country: 'Pakistan', honor_code: true, - totalRegistrationTime: 0, + total_registration_time: 0, next: '/course/demo-course-url', }; @@ -206,7 +206,7 @@ describe('RegistrationPage', () => { country: 'Pakistan', honor_code: true, social_auth_provider: 'Apple', - totalRegistrationTime: 0, + total_registration_time: 0, }; store = mockStore({ @@ -239,7 +239,7 @@ describe('RegistrationPage', () => { password: 'password1', country: 'Ukraine', honor_code: true, - totalRegistrationTime: 0, + total_registration_time: 0, }; store.dispatch = jest.fn(store.dispatch); @@ -264,7 +264,7 @@ describe('RegistrationPage', () => { password: 'password1', country: 'Ukraine', honor_code: true, - totalRegistrationTime: 0, + total_registration_time: 0, }; store.dispatch = jest.fn(store.dispatch); @@ -290,7 +290,7 @@ describe('RegistrationPage', () => { password: 'password1', country: 'Pakistan', honor_code: true, - totalRegistrationTime: 0, + total_registration_time: 0, marketing_emails_opt_in: true, }; @@ -317,7 +317,7 @@ describe('RegistrationPage', () => { password: 'password1', country: 'Pakistan', honor_code: true, - totalRegistrationTime: 0, + total_registration_time: 0, }; store.dispatch = jest.fn(store.dispatch); @@ -882,7 +882,7 @@ describe('RegistrationPage', () => { email: 'john.doe@example.com', country: 'PK', social_auth_provider: 'Apple', - totalRegistrationTime: 0, + total_registration_time: 0, })); }); }); diff --git a/src/register/components/tests/ConfigurableRegistrationForm.test.jsx b/src/register/components/tests/ConfigurableRegistrationForm.test.jsx index 537d11eb..3d664260 100644 --- a/src/register/components/tests/ConfigurableRegistrationForm.test.jsx +++ b/src/register/components/tests/ConfigurableRegistrationForm.test.jsx @@ -245,7 +245,7 @@ describe('ConfigurableRegistrationForm', () => { country: 'Pakistan', honor_code: true, profession: 'Engineer', - totalRegistrationTime: 0, + total_registration_time: 0, }; store.dispatch = jest.fn(store.dispatch); @@ -356,7 +356,7 @@ describe('ConfigurableRegistrationForm', () => { password: 'password1', country: 'Ukraine', honor_code: true, - totalRegistrationTime: 0, + total_registration_time: 0, }; store = mockStore({ diff --git a/src/register/data/utils.js b/src/register/data/utils.js index 747f2f2c..25694527 100644 --- a/src/register/data/utils.js +++ b/src/register/data/utils.js @@ -134,8 +134,8 @@ export const prepareRegistrationPayload = ( delete payload.marketingEmailsOptIn; } - payload = snakeCaseObject(payload); payload.totalRegistrationTime = totalRegistrationTime; + payload = snakeCaseObject(payload); // add query params to the payload payload = { ...payload, ...queryParams };