This repository has been archived by the owner on Feb 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(#105): started with auth login test cases
- Loading branch information
Andreas Gasser
committed
Apr 17, 2019
1 parent
c434a56
commit d7701ca
Showing
6 changed files
with
2,244 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from 'react'; | ||
import { mount } from 'enzyme'; | ||
import toJson from 'enzyme-to-json'; | ||
import 'jest-styled-components'; | ||
|
||
import { MemoryRouter } from 'react-router-dom'; | ||
|
||
import { AuthHeader, AuthFooter, __testables__ } from '../AuthComponents'; | ||
|
||
describe('AuthComponent test suite', () => { | ||
describe('AuthHeader test suite', () => { | ||
it('should render with children', () => { | ||
const children = <p>children</p>; | ||
const wrapper = mount(<AuthHeader>{children}</AuthHeader>); | ||
expect(wrapper).toBeTruthy(); | ||
|
||
expect(toJson(wrapper)).toMatchSnapshot(); | ||
}); | ||
}); | ||
|
||
describe('AuthFooter test suite', () => { | ||
const getFooter = (props) => { | ||
const wrapper = mount( | ||
<MemoryRouter> | ||
<AuthFooter {...props} /> | ||
</MemoryRouter> | ||
); | ||
return wrapper.find(AuthFooter); | ||
} | ||
|
||
it('should render with children', () => { | ||
const href = 'http://www.google.com'; | ||
const children = <p>children</p>; | ||
|
||
const wrapper = getFooter({ href, children }); | ||
expect(wrapper).toBeTruthy(); | ||
|
||
expect(toJson(wrapper)).toMatchSnapshot(); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.