-
Notifications
You must be signed in to change notification settings - Fork 2
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
82209c0
commit 1e92a09
Showing
3 changed files
with
64 additions
and
1 deletion.
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,28 @@ | ||
|
||
codecov: | ||
notify: | ||
require_ci_to_pass: true | ||
comment: | ||
behavior: default | ||
layout: header, diff | ||
require_changes: false | ||
coverage: | ||
precision: 2 | ||
range: | ||
- 90.0 | ||
- 100.0 | ||
round: down | ||
status: | ||
changes: false | ||
patch: true | ||
project: true | ||
parsers: | ||
gcov: | ||
branch_detection: | ||
conditional: true | ||
loop: true | ||
macro: false | ||
method: false | ||
javascript: | ||
enable_partials: false | ||
|
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,35 @@ | ||
|
||
describe('Test Offline', () => { | ||
const React = require('react'); | ||
const enzyme = require('enzyme'); | ||
const shallow = enzyme.shallow; | ||
const Offline = require('components/Offline/Offline').default; | ||
|
||
it('Offline should show message when without internet', (done) => { | ||
|
||
window.navigator.__defineGetter__('onLine', function(){ | ||
return false; | ||
}); | ||
|
||
let component = shallow(<Offline />); | ||
|
||
expect(component.text()).toEqual('Off Line'); | ||
expect(component.state().networkStatus).toEqual({"display": ""}); | ||
|
||
done(); | ||
|
||
}); | ||
|
||
it('Offline should display none when with internet', (done) => { | ||
|
||
window.navigator.__defineGetter__('onLine', function(){ | ||
return true; | ||
}); | ||
|
||
let component = shallow(<Offline />); | ||
|
||
expect(component.state().networkStatus).toEqual({"display": "none"}); | ||
done(); | ||
|
||
}); | ||
}); |