-
Notifications
You must be signed in to change notification settings - Fork 45
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
Showing
14 changed files
with
86 additions
and
48 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
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 |
---|---|---|
@@ -1,34 +1,16 @@ | ||
import * as React from 'react' | ||
import { render } from '@testing-library/react' | ||
import { Provider } from 'react-redux' | ||
import { configureAppStore } from 'store/configureStore' | ||
import { NetworkState } from 'app/state/network/types' | ||
|
||
import { TimeToEpoch } from '..' | ||
|
||
const renderComponent = (store: any, epoch: number) => | ||
render( | ||
<Provider store={store}> | ||
<TimeToEpoch epoch={epoch} /> | ||
</Provider>, | ||
) | ||
const renderComponent = (currentEpoch: number, epoch: number) => | ||
render(<TimeToEpoch currentEpoch={currentEpoch} epoch={epoch} />) | ||
|
||
describe('<TimeToEpoch />', () => { | ||
let store: ReturnType<typeof configureAppStore> | ||
|
||
beforeEach(() => { | ||
store = configureAppStore({ | ||
network: { | ||
epoch: 10000, | ||
} as NetworkState, | ||
}) | ||
}) | ||
|
||
it('should estimate debonding times', () => { | ||
expect(renderComponent(store, 10336).container.textContent).toEqual('in 14 days') | ||
expect(renderComponent(store, 10306).container.textContent).toEqual('in 13 days') | ||
expect(renderComponent(store, 10086).container.textContent).toEqual('in 4 days') | ||
expect(renderComponent(store, 10047).container.textContent).toEqual('in 47 hours') | ||
expect(renderComponent(store, 10001).container.textContent).toEqual('in 1 hour') | ||
expect(renderComponent(10000, 10336).container.textContent).toEqual('in 14 days') | ||
expect(renderComponent(10000, 10306).container.textContent).toEqual('in 13 days') | ||
expect(renderComponent(10000, 10086).container.textContent).toEqual('in 4 days') | ||
expect(renderComponent(10000, 10047).container.textContent).toEqual('in 47 hours') | ||
expect(renderComponent(10000, 10001).container.textContent).toEqual('in 1 hour') | ||
}) | ||
}) |
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
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
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
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