This repository has been archived by the owner on May 10, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
157ca67
commit e45a352
Showing
5 changed files
with
72 additions
and
2 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
33 changes: 33 additions & 0 deletions
33
web/tests/components/__snapshots__/header-btn.test.js.snap
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,33 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Header button should be rendered correctly when closed 1`] = ` | ||
<HeaderBtn | ||
handleClick={[MockFunction]} | ||
isOpen={false} | ||
> | ||
<button | ||
className="header-btn header-btn-closed" | ||
onClick={[Function]} | ||
> | ||
<div | ||
className="header-btn-arrow header-btn-arrow-right" | ||
/> | ||
</button> | ||
</HeaderBtn> | ||
`; | ||
|
||
exports[`Header button should be rendered correctly when open 1`] = ` | ||
<HeaderBtn | ||
handleClick={[MockFunction]} | ||
isOpen={true} | ||
> | ||
<button | ||
className="header-btn header-btn-open" | ||
onClick={[Function]} | ||
> | ||
<div | ||
className="header-btn-arrow" | ||
/> | ||
</button> | ||
</HeaderBtn> | ||
`; |
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,18 @@ | ||
import { mount } from 'enzyme'; | ||
import React from 'react'; | ||
|
||
import HeaderBtn from '../../src/components/header-btn'; | ||
|
||
const clickHandler = jest.fn(); | ||
|
||
test('Header button should be rendered correctly when closed', () => { | ||
let component = mount(<HeaderBtn isOpen={false} handleClick={clickHandler} />); | ||
|
||
expect(component).toMatchSnapshot(); | ||
}); | ||
|
||
test('Header button should be rendered correctly when open', () => { | ||
let component = mount(<HeaderBtn isOpen={true} handleClick={clickHandler} />); | ||
|
||
expect(component).toMatchSnapshot(); | ||
}); |
File renamed without changes.
File renamed without changes.