Skip to content

Commit 6c898c3

Browse files
fix frontend tests
1 parent 7c1cfe8 commit 6c898c3

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

frontend/test/Login.test.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ describe("<LoginForm />", () => {
5353

5454
it("should have the expected props on the username field", () => {
5555
expect(usernameInput.props()).toEqual({
56+
error: null,
5657
id: "username",
5758
name: "username",
5859
value: "",
@@ -68,6 +69,7 @@ describe("<LoginForm />", () => {
6869

6970
it("should have the expected props on the password field", () => {
7071
expect(passwordInput.props()).toEqual({
72+
error: null,
7173
id: "password",
7274
name: "password",
7375
value: "",
@@ -83,12 +85,11 @@ describe("<LoginForm />", () => {
8385

8486
it("should have the expected props on the button", () => {
8587
expect(signInButton.props()).toEqual({
86-
type: "button",
88+
type: "submit",
8789
variant: "contained",
88-
style: expect.objectContaining({
90+
style: {
8991
marginTop: "10px",
90-
}),
91-
onClick: expect.any(Function),
92+
},
9293
children: "Sign In",
9394
})
9495
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`<LoginForm /> Unit tests should match the snapshot 1`] = `"<div class=\\"login-form\\"><form class=\\"login-form__form\\"><div class=\\"MuiFormGroup-root login-form__input\\"><div class=\\"MuiFormControl-root\\"><label class=\\"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated\\" data-shrink=\\"false\\" for=\\"username\\">Username</label><div class=\\"MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-formControl MuiInput-formControl\\" required=\\"\\"><input type=\\"username\\" aria-invalid=\\"false\\" id=\\"username\\" name=\\"username\\" required=\\"\\" value=\\"\\" class=\\"MuiInputBase-input MuiInput-input\\"/></div></div></div><div class=\\"MuiFormGroup-root login-form__input\\"><div class=\\"MuiFormControl-root\\"><label class=\\"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated\\" data-shrink=\\"false\\" for=\\"password\\">Password</label><div class=\\"MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-formControl MuiInput-formControl\\" required=\\"\\"><input type=\\"password\\" aria-invalid=\\"false\\" id=\\"password\\" name=\\"password\\" required=\\"\\" value=\\"\\" class=\\"MuiInputBase-input MuiInput-input\\"/></div></div></div><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-contained\\" tabindex=\\"0\\" type=\\"button\\" style=\\"margin-top:10px\\"><span class=\\"MuiButton-label\\">Sign In</span></button></form></div>"`;
3+
exports[`<LoginForm /> Unit tests should match the snapshot 1`] = `"<div class=\\"login-form\\"><form class=\\"login-form__form\\"><div class=\\"MuiFormGroup-root login-form__input\\"><div class=\\"MuiFormControl-root\\"><label class=\\"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated\\" data-shrink=\\"false\\" for=\\"username\\">Username</label><div class=\\"MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-formControl MuiInput-formControl\\" required=\\"\\"><input type=\\"username\\" id=\\"username\\" name=\\"username\\" required=\\"\\" value=\\"\\" class=\\"MuiInputBase-input MuiInput-input\\"/></div></div></div><div class=\\"MuiFormGroup-root login-form__input\\"><div class=\\"MuiFormControl-root\\"><label class=\\"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated\\" data-shrink=\\"false\\" for=\\"password\\">Password</label><div class=\\"MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-formControl MuiInput-formControl\\" required=\\"\\"><input type=\\"password\\" id=\\"password\\" name=\\"password\\" required=\\"\\" value=\\"\\" class=\\"MuiInputBase-input MuiInput-input\\"/></div></div></div><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-contained\\" tabindex=\\"0\\" type=\\"submit\\" style=\\"margin-top:10px\\"><span class=\\"MuiButton-label\\">Sign In</span></button></form></div>"`;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`<UserSearch /> should match the snapshot 1`] = `"<div class=\\"participant-search\\"><div align=\\"center\\"><h5 class=\\"MuiTypography-root participant-head MuiTypography-h5 MuiTypography-gutterBottom\\"><b>Participant Search</b></h5><p class=\\"MuiTypography-root participant-reminder MuiTypography-body2 MuiTypography-gutterBottom\\"><b>Reminder:</b> Search for participant profile prior to creating a new profile</p><form class=\\"participant-search__form\\"><div class=\\"MuiFormGroup-root participant-search__input\\"><div class=\\"MuiFormControl-root\\"><label class=\\"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated\\" data-shrink=\\"false\\" for=\\"user_id\\">User ID</label><div class=\\"MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-formControl MuiInput-formControl\\"><input aria-invalid=\\"false\\" id=\\"user_id\\" name=\\"user_id\\" type=\\"text\\" class=\\"MuiInputBase-input MuiInput-input\\" value=\\"\\"></div></div></div><h5 class=\\"MuiTypography-root participant-head MuiTypography-h5 MuiTypography-gutterBottom\\"><b>Or</b></h5><div class=\\"MuiFormGroup-root participant-search__input\\"><div class=\\"MuiFormControl-root\\"><label class=\\"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated\\" data-shrink=\\"false\\" for=\\"first_name\\">First Name</label><div class=\\"MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-formControl MuiInput-formControl\\"><input aria-invalid=\\"false\\" id=\\"first_name\\" name=\\"first_name\\" type=\\"text\\" class=\\"MuiInputBase-input MuiInput-input\\" value=\\"\\"></div></div></div><div class=\\"MuiFormGroup-root participant-search__input\\"><div class=\\"MuiFormControl-root\\"><label class=\\"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated\\" data-shrink=\\"false\\" for=\\"last_name\\">Last Name</label><div class=\\"MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-formControl MuiInput-formControl\\"><input aria-invalid=\\"false\\" id=\\"last_name\\" name=\\"last_name\\" type=\\"text\\" class=\\"MuiInputBase-input MuiInput-input\\" value=\\"\\"></div></div></div><p class=\\"error-message\\"></p><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-contained\\" tabindex=\\"0\\" type=\\"submit\\" style=\\"margin-top: 30px;\\"><span class=\\"MuiButton-label\\">Submit</span><span class=\\"MuiTouchRipple-root\\"></span></button></form></div></div>"`;
3+
exports[`<UserSearch /> should match the snapshot 1`] = `"<div class=\\"participant-search\\"><div align=\\"center\\"><h5 class=\\"MuiTypography-root participant-head MuiTypography-h5 MuiTypography-gutterBottom\\"><b>Participant Search</b></h5><p class=\\"MuiTypography-root participant-reminder MuiTypography-body2 MuiTypography-gutterBottom\\"><b>Reminder:</b> Search for participant profile prior to creating a new profile</p><form class=\\"participant-search__form\\"><div class=\\"MuiFormGroup-root participant-search__input\\"><div class=\\"MuiFormControl-root\\"><label class=\\"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated\\" data-shrink=\\"false\\" for=\\"user_id\\">User ID</label><div class=\\"MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-formControl MuiInput-formControl\\"><input aria-invalid=\\"false\\" id=\\"user_id\\" name=\\"user_id\\" type=\\"text\\" class=\\"MuiInputBase-input MuiInput-input\\" value=\\"\\"></div></div></div><h5 class=\\"MuiTypography-root participant-head MuiTypography-h5 MuiTypography-gutterBottom\\"><b>Or</b></h5><div class=\\"MuiFormGroup-root participant-search__input\\"><div class=\\"MuiFormControl-root\\"><label class=\\"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated\\" data-shrink=\\"false\\" for=\\"first_name\\">First Name</label><div class=\\"MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-formControl MuiInput-formControl\\"><input aria-invalid=\\"false\\" id=\\"first_name\\" name=\\"first_name\\" type=\\"text\\" class=\\"MuiInputBase-input MuiInput-input\\" value=\\"\\"></div></div></div><div class=\\"MuiFormGroup-root participant-search__input\\"><div class=\\"MuiFormControl-root\\"><label class=\\"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated\\" data-shrink=\\"false\\" for=\\"last_name\\">Last Name</label><div class=\\"MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-formControl MuiInput-formControl\\"><input aria-invalid=\\"false\\" id=\\"last_name\\" name=\\"last_name\\" type=\\"text\\" class=\\"MuiInputBase-input MuiInput-input\\" value=\\"\\"></div></div></div><p class=\\"error-message\\"></p><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-contained Mui-disabled Mui-disabled\\" tabindex=\\"-1\\" type=\\"submit\\" disabled=\\"\\" style=\\"margin-top: 30px;\\"><span class=\\"MuiButton-label\\">Submit</span></button></form></div></div>"`;

0 commit comments

Comments
 (0)