From 2428b4c38958ee76572d07aefdfc7d122a0116f9 Mon Sep 17 00:00:00 2001 From: Blue Date: Wed, 28 Aug 2024 14:58:40 +0500 Subject: [PATCH] fix: covert totalRegistrationTime to snake case (#1302) Description: Convert 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 5633c753..5f23e2c2 100644 --- a/src/register/RegistrationPage.test.jsx +++ b/src/register/RegistrationPage.test.jsx @@ -188,7 +188,7 @@ describe('RegistrationPage', () => { password: 'password1', country: 'Pakistan', honor_code: true, - totalRegistrationTime: 0, + total_registration_time: 0, next: '/course/demo-course-url', app_name: APP_NAME, }; @@ -212,7 +212,7 @@ describe('RegistrationPage', () => { country: 'Pakistan', honor_code: true, social_auth_provider: 'Apple', - totalRegistrationTime: 0, + total_registration_time: 0, app_name: APP_NAME, }; @@ -246,7 +246,7 @@ describe('RegistrationPage', () => { password: 'password1', country: 'Ukraine', honor_code: true, - totalRegistrationTime: 0, + total_registration_time: 0, }; store.dispatch = jest.fn(store.dispatch); @@ -271,7 +271,7 @@ describe('RegistrationPage', () => { password: 'password1', country: 'Ukraine', honor_code: true, - totalRegistrationTime: 0, + total_registration_time: 0, }; store.dispatch = jest.fn(store.dispatch); @@ -297,7 +297,7 @@ describe('RegistrationPage', () => { password: 'password1', country: 'Pakistan', honor_code: true, - totalRegistrationTime: 0, + total_registration_time: 0, marketing_emails_opt_in: true, app_name: APP_NAME, }; @@ -325,7 +325,7 @@ describe('RegistrationPage', () => { password: 'password1', country: 'Pakistan', honor_code: true, - totalRegistrationTime: 0, + total_registration_time: 0, app_name: APP_NAME, }; @@ -891,7 +891,7 @@ describe('RegistrationPage', () => { email: 'john.doe@example.com', country: 'PK', social_auth_provider: 'Apple', - totalRegistrationTime: 0, + total_registration_time: 0, app_name: APP_NAME, })); }); diff --git a/src/register/components/tests/ConfigurableRegistrationForm.test.jsx b/src/register/components/tests/ConfigurableRegistrationForm.test.jsx index 670415f7..61a25848 100644 --- a/src/register/components/tests/ConfigurableRegistrationForm.test.jsx +++ b/src/register/components/tests/ConfigurableRegistrationForm.test.jsx @@ -251,7 +251,7 @@ describe('ConfigurableRegistrationForm', () => { country: 'Pakistan', honor_code: true, profession: 'Engineer', - totalRegistrationTime: 0, + total_registration_time: 0, }; store.dispatch = jest.fn(store.dispatch); @@ -362,7 +362,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 ee08f0b6..e7773e2b 100644 --- a/src/register/data/utils.js +++ b/src/register/data/utils.js @@ -126,8 +126,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 };