-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from andela/ft-password-reset-#168049942
#168049942 password reset
- Loading branch information
Showing
22 changed files
with
625 additions
and
10 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
24 changes: 24 additions & 0 deletions
24
src/__tests__/components/passwordReset/forgotEmailForm.test.js
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* eslint-disable react/jsx-props-no-spreading */ | ||
import React from "react"; | ||
import { mount } from "enzyme"; | ||
import sinon from "sinon"; | ||
import { PassReset } from "../../../components/passwordReset/forgotEmailForm"; | ||
|
||
const onSubmit = sinon.spy(); | ||
|
||
const props = { | ||
passWordResetAction: jest.fn(), | ||
}; | ||
const setUp = () => mount(<PassReset onSubmit={onSubmit} {...props} />); | ||
// const findByAttr = (wrapper, dataTest) => wrapper.find(`[data-test="${dataTest}"]`); | ||
|
||
test("it renders component successfully", () => { | ||
const wrapper = setUp(); | ||
expect(wrapper.length).toBe(1); | ||
}); | ||
|
||
it("should check if data are valid when you send the data without typing", () => { | ||
const wrapper = setUp(); | ||
const button = wrapper.find("button"); | ||
button.simulate("submit"); | ||
}); |
10 changes: 10 additions & 0 deletions
10
src/__tests__/components/passwordReset/passwordResetConfirmation.test.js
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from "react"; | ||
import { shallow } from "enzyme"; | ||
import VerifyPasswordReset from "../../../components/passwordReset/passwordResetConfirmation"; | ||
|
||
const setUp = () => shallow(<VerifyPasswordReset />); | ||
// tests | ||
test("it renders the component successfully", () => { | ||
const wrapper = setUp(); | ||
expect(wrapper.length).toBe(1); | ||
}); |
26 changes: 26 additions & 0 deletions
26
src/__tests__/components/passwordReset/resetPassword.test.js
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* eslint-disable react/jsx-props-no-spreading */ | ||
import React from "react"; | ||
import { mount } from "enzyme"; | ||
import sinon from "sinon"; | ||
import { PasswordChange } from "../../../components/passwordReset/resetPassword"; | ||
|
||
const onSubmit = sinon.spy(); | ||
const props = { | ||
passWordChangeAction: jest.fn(), | ||
match: { | ||
params: "token", | ||
}, | ||
}; | ||
const setUp = () => mount(<PasswordChange onSubmit={onSubmit} {...props} />); | ||
// const findByAttr = (wrapper, dataTest) => wrapper.find(`[data-test="${dataTest}"]`); | ||
|
||
test("it renders component successfully", () => { | ||
const wrapper = setUp(); | ||
expect(wrapper.length).toBe(1); | ||
}); | ||
|
||
it("should check if data are valid when you send the data without typing", () => { | ||
const wrapper = setUp(); | ||
const button = wrapper.find("button"); | ||
button.simulate("submit"); | ||
}); |
Oops, something went wrong.