Skip to content

Commit

Permalink
feat(socialAuth):
Browse files Browse the repository at this point in the history
create actions for social Auth
test functions
manually test functionality
  • Loading branch information
chekwas88 committed Jul 24, 2019
1 parent 9950d49 commit b47daa5
Show file tree
Hide file tree
Showing 12 changed files with 159 additions and 62 deletions.
74 changes: 36 additions & 38 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"@fortawesome/react-fontawesome": "^0.1.4",
"axios": "^0.19.0",
"axios-mock-adapter": "^1.17.0",
"babel-eslint": "^10.0.2",
"bootstrap": "^4.3.1",
"classnames": "^2.2.6",
"clean-webpack-plugin": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class Header extends React.Component {
<Button type="button" text="Log in" classname="button-style" />
</Link>
<Link to="/signup">
<Button type="button" text="SignIn" classname="button-style" />
<Button type="button" text="SignUp" classname="button-style" />
</Link>
</NavItem>
);
Expand Down
1 change: 0 additions & 1 deletion src/routes/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const Routes = () => (
<Route path="/aboutus" component={About} />
<Route path="/profile" component={Profile} />
<Route path="/password-reset" component={ResetPassword} />
<Route path="/signup" component={signUpPage} />
<Route path="/change-password" component={changePassword} />
<Route path="/dashboard" component={Dashboard} />
<Route component={NotFound} />
Expand Down
1 change: 0 additions & 1 deletion src/test/actions/moduleActions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import configureMockStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import nock from 'nock';
import 'regenerator-runtime';
import { getModules } from '../../../store/actions/moduleActions';

const middlewares = [thunk];
Expand Down
16 changes: 16 additions & 0 deletions src/test/actions/socialAuth.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { getToken, socialAuthPath } from '../../../store/actions/authActions/socialAuthActions';
// export const getToken = (tokenString) => {
// const startIndex = tokenString.indexOf('=') + 1;
// const token = tokenString.slice(startIndex);
// return token;
// };

describe('social actions', () => {
test('should return a string', () => {
const token = getToken('=khsbbs');
expect(token).toEqual('khsbbs');
});
test('should ', () => {
expect(socialAuthPath('google')).toBe(null);
});
});
5 changes: 4 additions & 1 deletion src/test/views/signUp.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { SignUp } from '../../views/Signup/SignUp';

const historyMock = { push: jest.fn() };
const props = {
registerUser: () => {},
registerAction: () => {},
socialSignOn: () => {},
auth: {},
errors: {},
};
Expand All @@ -20,10 +21,12 @@ describe('Signup component', () => {
wrapper = setUp();
sinon.spy(SignUp.prototype, 'onChange');
sinon.spy(SignUp.prototype, 'onSubmit');
sinon.spy(SignUp.prototype, 'componentDidMount');
});
afterEach(() => {
SignUp.prototype.onChange.restore();
SignUp.prototype.onSubmit.restore();
SignUp.prototype.componentDidMount.restore();
});
it('ensure onchange is called for firstname', (done) => {
const event = { target: { name: 'firstName', value: 'spam' } };
Expand Down
2 changes: 1 addition & 1 deletion src/views/Login/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class Login extends Component {
</p>
<p>
Dont have an account yet?
<Link className="sign-up" to="/sign-up">
<Link className="sign-up" to="/signup">
{' '}
Sign Up
</Link>
Expand Down
Loading

0 comments on commit b47daa5

Please sign in to comment.