-
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.
- Loading branch information
1 parent
d4c16eb
commit e90ba40
Showing
2 changed files
with
81 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'react' | ||
import { render } from '@testing-library/react' | ||
import { ReloadInfo } from './index' | ||
|
||
describe('ReloadInfo', function () { | ||
beforeAll(function () { | ||
localStorage.removeItem('showReloadInfo') | ||
}) | ||
|
||
test('renders correctly', function () { | ||
const { asFragment } = render(<ReloadInfo />) | ||
|
||
expect(asFragment()).toMatchSnapshot() | ||
}) | ||
|
||
test('not renders if dismissed', function () { | ||
localStorage.setItem('showReloadInfo', '0') | ||
const { asFragment } = render(<ReloadInfo />) | ||
|
||
expect(asFragment()).toMatchSnapshot() | ||
}) | ||
}) |
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,59 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ReloadInfo not renders if dismissed 1`] = ` | ||
<DocumentFragment> | ||
<div | ||
class="ui teal hidden icon message" | ||
> | ||
<i | ||
aria-hidden="true" | ||
class="close icon" | ||
/> | ||
<i | ||
aria-hidden="true" | ||
class="info icon" | ||
/> | ||
<div | ||
class="content" | ||
> | ||
<div | ||
class="header" | ||
> | ||
Information | ||
</div> | ||
<p> | ||
The messages update automatically. There is no need to reload the entire page. | ||
</p> | ||
</div> | ||
</div> | ||
</DocumentFragment> | ||
`; | ||
|
||
exports[`ReloadInfo renders correctly 1`] = ` | ||
<DocumentFragment> | ||
<div | ||
class="ui teal icon message" | ||
> | ||
<i | ||
aria-hidden="true" | ||
class="close icon" | ||
/> | ||
<i | ||
aria-hidden="true" | ||
class="info icon" | ||
/> | ||
<div | ||
class="content" | ||
> | ||
<div | ||
class="header" | ||
> | ||
Information | ||
</div> | ||
<p> | ||
The messages update automatically. There is no need to reload the entire page. | ||
</p> | ||
</div> | ||
</div> | ||
</DocumentFragment> | ||
`; |