-
Notifications
You must be signed in to change notification settings - Fork 68
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
8 changed files
with
62 additions
and
57 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
11 changes: 6 additions & 5 deletions
11
src/containers/shared/components/Transaction/OracleDelete/test/OracleDeleteSimple.test.tsx
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,12 +1,13 @@ | ||
import { createSimpleWrapperFactory, expectSimpleRowText } from '../../test' | ||
import { screen, cleanup } from '@testing-library/react' | ||
import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' | ||
import { Simple } from '../Simple' | ||
import OracleDelete from './mock_data/OracleDelete.json' | ||
|
||
const createWrapper = createSimpleWrapperFactory(Simple) | ||
const renderComponent = createSimpleRenderFactory(Simple) | ||
describe('OracleDelete: Simple', () => { | ||
afterEach(cleanup) | ||
it('renders', () => { | ||
const wrapper = createWrapper(OracleDelete) | ||
expectSimpleRowText(wrapper, 'oracle-document-id', '1') | ||
wrapper.unmount() | ||
renderComponent(OracleDelete) | ||
expectSimpleRowText(screen, 'oracle-document-id', '1') | ||
}) | ||
}) |
13 changes: 8 additions & 5 deletions
13
...ntainers/shared/components/Transaction/OracleDelete/test/OracleDeleteTableDetail.test.tsx
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,13 +1,16 @@ | ||
import { createTableDetailWrapperFactory } from '../../test' | ||
import { screen, cleanup } from '@testing-library/react' | ||
import { createTableDetailRenderFactory } from '../../test' | ||
import { TableDetail } from '../TableDetail' | ||
import OracleDelete from './mock_data/OracleDelete.json' | ||
|
||
const createWrapper = createTableDetailWrapperFactory(TableDetail) | ||
const renderComponent = createTableDetailRenderFactory(TableDetail) | ||
|
||
describe('OracleDelete: TableDetail', () => { | ||
afterEach(cleanup) | ||
it('renders', () => { | ||
const wrapper = createWrapper(OracleDelete) | ||
expect(wrapper).toHaveText('oracle_document_id: 1') | ||
wrapper.unmount() | ||
renderComponent(OracleDelete) | ||
expect(screen.getByTestId('oracle-document-id')).toHaveTextContent( | ||
`oracle_document_id: 1`, | ||
) | ||
}) | ||
}) |
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
19 changes: 10 additions & 9 deletions
19
src/containers/shared/components/Transaction/OracleSet/test/OracleSetSimple.test.tsx
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,24 +1,25 @@ | ||
import { createSimpleWrapperFactory, expectSimpleRowText } from '../../test' | ||
import { cleanup, screen } from '@testing-library/react' | ||
import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' | ||
import { Simple } from '../Simple' | ||
import OracleSet from './mock_data/OracleSet.json' | ||
|
||
const createWrapper = createSimpleWrapperFactory(Simple) | ||
const renderComponent = createSimpleRenderFactory(Simple) | ||
describe('OracleSet: Simple', () => { | ||
afterEach(cleanup) | ||
it('renders', () => { | ||
const wrapper = createWrapper(OracleSet) | ||
expectSimpleRowText(wrapper, 'oracle-document-id', '1') | ||
expectSimpleRowText(wrapper, 'provider', 'provider') | ||
renderComponent(OracleSet) | ||
expectSimpleRowText(screen, 'oracle-document-id', '1') | ||
expectSimpleRowText(screen, 'provider', 'provider') | ||
expectSimpleRowText( | ||
wrapper, | ||
screen, | ||
'last-update-time', | ||
'May 13, 2024 at 9:05:10 PM', | ||
) | ||
expectSimpleRowText(wrapper, 'asset-class', 'currency') | ||
expectSimpleRowText(screen, 'asset-class', 'currency') | ||
expectSimpleRowText( | ||
wrapper, | ||
screen, | ||
'trading-pairs', | ||
'74.2\uE900 XRP/USD1.03BTC/AUDT', | ||
) | ||
wrapper.unmount() | ||
}) | ||
}) |
11 changes: 6 additions & 5 deletions
11
src/containers/shared/components/Transaction/OracleSet/test/OracleSetTableDetail.test.tsx
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,19 +1,20 @@ | ||
import { createTableDetailWrapperFactory } from '../../test' | ||
import { cleanup, screen } from '@testing-library/react' | ||
import { createTableDetailRenderFactory } from '../../test' | ||
import { TableDetail } from '../TableDetail' | ||
import OracleSet from './mock_data/OracleSet.json' | ||
|
||
const createWrapper = createTableDetailWrapperFactory(TableDetail) | ||
const renderComponent = createTableDetailRenderFactory(TableDetail) | ||
|
||
describe('OracleDelete: TableDetail', () => { | ||
afterEach(cleanup) | ||
it('renders', () => { | ||
const wrapper = createWrapper(OracleSet) | ||
expect(wrapper).toHaveText( | ||
renderComponent(OracleSet) | ||
expect(screen.getByTestId('table-detail')).toHaveTextContent( | ||
'oracle_document_id: 1' + | ||
'provider: provider' + | ||
'asset_class: currency' + | ||
'last_update_time: May 13, 2024 at 9:05:10 PM' + | ||
'trading_pairs: 74.2\uE900 XRP/USD, 1.03BTC/AUDT', | ||
) | ||
wrapper.unmount() | ||
}) | ||
}) |