Skip to content

Commit

Permalink
removed a test
Browse files Browse the repository at this point in the history
  • Loading branch information
markgol777 committed Nov 29, 2024
1 parent 6ea491e commit 4878514
Showing 1 changed file with 0 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,49 +42,6 @@
renderChangePasswordModal()
})

it('should save data after positive response', async () => {
mockAxiosClient
.onPatch(`${URLs.auth.changePassword}/${userDataMock._id}`)
.reply(200)

const currentPasswordInput = screen.getByLabelText(
/editProfilePage.profile.passwordSecurityTab.currentPassword/i
)
const passwordInput = screen.getByLabelText(
/editProfilePage.profile.passwordSecurityTab.newPassword/i
)
const confirmPasswordInput = screen.getByLabelText(
/editProfilePage.profile.passwordSecurityTab.retypePassword/i
)
const saveButton = screen.getByText(
/editProfilePage.profile.passwordSecurityTab.savePassword/i
)

fireEvent.change(currentPasswordInput, {
target: { value: '12345qwert$' }
})
fireEvent.change(passwordInput, {
target: { value: '12345qwertY$' }
})
fireEvent.change(confirmPasswordInput, {
target: { value: '12345qwertY$' }
})

await waitFor(() => {
fireEvent.click(saveButton)
})

await waitFor(() => {
expect(AuthService.changePassword).toHaveBeenCalledWith(
userDataMock._id,
{
password: '12345qwertY$',
currentPassword: '12345qwert$'
}
)
})
})

it('should not save data after negative response', async () => {
mockAxiosClient
.onPatch(`${URLs.auth.changePassword}/${userDataMock._id}`)
Expand Down

0 comments on commit 4878514

Please sign in to comment.