generated from openedx/frontend-template-application
-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: TPA data not auto-populated (#1156)
- Loading branch information
1 parent
94e8236
commit 2590956
Showing
8 changed files
with
92 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,13 +64,13 @@ describe('RegistrationPage', () => { | |
marketingEmailsOptIn: true, | ||
}, | ||
formFields: { | ||
firstname: '', lastname: '', email: '', username: '', password: '', | ||
firstName: '', lastName: '', email: '', username: '', password: '', | ||
}, | ||
emailSuggestion: { | ||
suggestion: '', type: '', | ||
}, | ||
errors: { | ||
firstname: '', lastname: '', email: '', username: '', password: '', | ||
firstName: '', lastName: '', email: '', username: '', password: '', | ||
}, | ||
}; | ||
|
||
|
@@ -134,8 +134,8 @@ describe('RegistrationPage', () => { | |
}); | ||
|
||
const populateRequiredFields = (getByLabelText, payload, isThirdPartyAuth = false) => { | ||
fireEvent.change(getByLabelText('First name'), { target: { value: payload.firstname, name: 'firstname' } }); | ||
fireEvent.change(getByLabelText('Last name'), { target: { value: payload.lastname, name: 'lastname' } }); | ||
fireEvent.change(getByLabelText('First name'), { target: { value: payload.first_name, name: 'firstName' } }); | ||
fireEvent.change(getByLabelText('Last name'), { target: { value: payload.last_name, name: 'lastName' } }); | ||
fireEvent.change(getByLabelText('Public username'), { target: { value: payload.username, name: 'username' } }); | ||
fireEvent.change(getByLabelText('Email'), { target: { value: payload.email, name: 'email' } }); | ||
|
||
|
@@ -153,8 +153,8 @@ describe('RegistrationPage', () => { | |
}); | ||
|
||
const emptyFieldValidation = { | ||
firstname: 'Enter your first name', | ||
lastname: 'Enter your last name', | ||
firstName: 'Enter your first name', | ||
lastName: 'Enter your last name', | ||
username: 'Username must be between 2 and 30 characters', | ||
email: 'Enter your email', | ||
password: 'Password criteria has not been met', | ||
|
@@ -171,8 +171,8 @@ describe('RegistrationPage', () => { | |
window.location = { href: getConfig().BASE_URL, search: '?next=/course/demo-course-url' }; | ||
|
||
const payload = { | ||
firstname: 'John', | ||
lastname: 'Doe', | ||
first_name: 'John', | ||
last_name: 'Doe', | ||
username: 'john_doe', | ||
email: '[email protected]', | ||
password: 'password1', | ||
|
@@ -195,8 +195,8 @@ describe('RegistrationPage', () => { | |
jest.spyOn(global.Date, 'now').mockImplementation(() => 0); | ||
|
||
const formPayload = { | ||
firstname: 'John', | ||
lastname: 'Doe', | ||
first_name: 'John', | ||
last_name: 'Doe', | ||
username: 'john_doe', | ||
email: '[email protected]', | ||
country: 'Pakistan', | ||
|
@@ -232,8 +232,8 @@ describe('RegistrationPage', () => { | |
jest.spyOn(global.Date, 'now').mockImplementation(() => 0); | ||
|
||
const payload = { | ||
firstname: 'John', | ||
lastname: 'Doe', | ||
first_name: 'John', | ||
last_name: 'Doe', | ||
username: 'john_doe', | ||
email: '[email protected]', | ||
password: 'password1', | ||
|
@@ -584,8 +584,8 @@ describe('RegistrationPage', () => { | |
registrationFormData: { | ||
...registrationFormData, | ||
formFields: { | ||
firstname: 'John', | ||
lastname: 'Doe', | ||
firstName: 'John', | ||
lastName: 'Doe', | ||
username: 'john_doe', | ||
email: '[email protected]', | ||
password: 'password1', | ||
|
@@ -599,8 +599,8 @@ describe('RegistrationPage', () => { | |
|
||
const { container } = render(routerWrapper(reduxWrapper(<IntlRegistrationPage {...props} />))); | ||
|
||
const firstNameInput = container.querySelector('input#firstname'); | ||
const lastNameInput = container.querySelector('input#lastname'); | ||
const firstNameInput = container.querySelector('input#firstName'); | ||
const lastNameInput = container.querySelector('input#lastName'); | ||
const usernameInput = container.querySelector('input#username'); | ||
const emailInput = container.querySelector('input#email'); | ||
const passwordInput = container.querySelector('input#password'); | ||
|
@@ -728,8 +728,8 @@ describe('RegistrationPage', () => { | |
thirdPartyAuthContext: { | ||
...initialState.commonComponents.thirdPartyAuthContext, | ||
pipelineUserDetails: { | ||
firstname: 'John', | ||
lastname: 'Doe', | ||
firstName: 'John', | ||
lastName: 'Doe', | ||
username: 'john_doe', | ||
email: '[email protected]', | ||
}, | ||
|
@@ -760,8 +760,8 @@ describe('RegistrationPage', () => { | |
registrationFormData: { | ||
...registrationFormData, | ||
formFields: { | ||
firstname: 'John', | ||
lastname: 'Doe', | ||
firstName: 'John', | ||
lastName: 'Doe', | ||
username: 'john_doe', | ||
email: '[email protected]', | ||
}, | ||
|
@@ -781,8 +781,8 @@ describe('RegistrationPage', () => { | |
...initialState.commonComponents.thirdPartyAuthContext, | ||
currentProvider: 'Apple', | ||
pipelineUserDetails: { | ||
firstname: 'John', | ||
lastname: 'Doe', | ||
firstName: 'John', | ||
lastName: 'Doe', | ||
username: 'john_doe', | ||
email: '[email protected]', | ||
}, | ||
|
@@ -794,8 +794,8 @@ describe('RegistrationPage', () => { | |
|
||
render(routerWrapper(reduxWrapper(<IntlRegistrationPage {...props} />))); | ||
expect(store.dispatch).toHaveBeenCalledWith(registerNewUser({ | ||
firstname: 'John', | ||
lastname: 'Doe', | ||
first_name: 'John', | ||
last_name: 'Doe', | ||
username: 'john_doe', | ||
email: '[email protected]', | ||
country: 'PK', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,13 +56,13 @@ describe('ConfigurableRegistrationForm', () => { | |
marketingEmailsOptIn: true, | ||
}, | ||
formFields: { | ||
firstname: '', lastname: '', email: '', username: '', password: '', | ||
firstName: '', lastName: '', email: '', username: '', password: '', | ||
}, | ||
emailSuggestion: { | ||
suggestion: '', type: '', | ||
}, | ||
errors: { | ||
firstname: '', lastname: '', email: '', username: '', password: '', | ||
firstName: '', lastName: '', email: '', username: '', password: '', | ||
}, | ||
}; | ||
|
||
|
@@ -128,8 +128,8 @@ describe('ConfigurableRegistrationForm', () => { | |
}); | ||
|
||
const populateRequiredFields = (getByLabelText, payload, isThirdPartyAuth = false) => { | ||
fireEvent.change(getByLabelText('First name'), { target: { value: payload.firstname, name: 'firstname' } }); | ||
fireEvent.change(getByLabelText('Last name'), { target: { value: payload.lastname, name: 'lastname' } }); | ||
fireEvent.change(getByLabelText('First name'), { target: { value: payload.first_name, name: 'firstName' } }); | ||
fireEvent.change(getByLabelText('Last name'), { target: { value: payload.last_name, name: 'lastName' } }); | ||
fireEvent.change(getByLabelText('Public username'), { target: { value: payload.username, name: 'username' } }); | ||
fireEvent.change(getByLabelText('Email'), { target: { value: payload.email, name: 'email' } }); | ||
|
||
|
@@ -239,8 +239,8 @@ describe('ConfigurableRegistrationForm', () => { | |
}); | ||
|
||
const payload = { | ||
firstname: 'John', | ||
lastname: 'Doe', | ||
first_name: 'John', | ||
last_name: 'Doe', | ||
username: 'john_doe', | ||
email: '[email protected]', | ||
password: 'password1', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.