-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Network): add table view (#1622)
- Loading branch information
1 parent
cbc146b
commit 507aa71
Showing
25 changed files
with
661 additions
and
61 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,30 @@ | ||
import {UNBREAKABLE_GAP} from '../../../utils/utils'; | ||
import {prepareClockSkewValue, preparePingTimeValue} from '../utils'; | ||
|
||
describe('preparePingTimeValue', () => { | ||
it('Should correctly prepare value', () => { | ||
expect(preparePingTimeValue(1)).toEqual(`0${UNBREAKABLE_GAP}ms`); | ||
expect(preparePingTimeValue(100)).toEqual(`0.1${UNBREAKABLE_GAP}ms`); | ||
expect(preparePingTimeValue(5_550)).toEqual(`6${UNBREAKABLE_GAP}ms`); | ||
expect(preparePingTimeValue(100_000)).toEqual(`100${UNBREAKABLE_GAP}ms`); | ||
}); | ||
}); | ||
|
||
describe('prepareClockSkewValue', () => { | ||
it('Should correctly prepare 0 or very low values', () => { | ||
expect(prepareClockSkewValue(0)).toEqual(`0${UNBREAKABLE_GAP}ms`); | ||
expect(prepareClockSkewValue(10)).toEqual(`0${UNBREAKABLE_GAP}ms`); | ||
expect(prepareClockSkewValue(-10)).toEqual(`0${UNBREAKABLE_GAP}ms`); | ||
}); | ||
it('Should correctly prepare positive values', () => { | ||
expect(prepareClockSkewValue(100)).toEqual(`+0.1${UNBREAKABLE_GAP}ms`); | ||
expect(prepareClockSkewValue(5_500)).toEqual(`+6${UNBREAKABLE_GAP}ms`); | ||
expect(prepareClockSkewValue(100_000)).toEqual(`+100${UNBREAKABLE_GAP}ms`); | ||
}); | ||
|
||
it('Should correctly prepare negative values', () => { | ||
expect(prepareClockSkewValue(-100)).toEqual(`-0.1${UNBREAKABLE_GAP}ms`); | ||
expect(prepareClockSkewValue(-5_500)).toEqual(`-6${UNBREAKABLE_GAP}ms`); | ||
expect(prepareClockSkewValue(-100_000)).toEqual(`-100${UNBREAKABLE_GAP}ms`); | ||
}); | ||
}); |
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
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
Oops, something went wrong.