Skip to content

Commit

Permalink
test: bring coverage up to required level
Browse files Browse the repository at this point in the history
  • Loading branch information
dexturr committed Jun 5, 2024
1 parent ab6a3ab commit 31de4d2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
27 changes: 24 additions & 3 deletions frontend/components/receipts/utils/order-table.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,26 @@ describe('OrderTable', () => {
peggedOrder: {
reference: vegaPeggedReference.PEGGED_REFERENCE_BEST_BID,
offset: '6'
},
icebergOpts: {
minimumVisibleSize: '1',
peakSize: '2'
}
})

const [priceRow, peggedInfoRow, sizeRow, marketRow, marketIdRow, orderRow, directionRow, typeRow, referenceRow] =
screen.getAllByTestId(dataTableLocators.dataRow)
const [
priceRow,
peggedInfoRow,
sizeRow,
marketRow,
marketIdRow,
orderRow,
directionRow,
typeRow,
referenceRow,
icebergPeakRow,
icebergMinRow
] = screen.getAllByTestId(dataTableLocators.dataRow)
expect(priceRow).toHaveTextContent('Price')
expect(priceRow).toHaveTextContent('123')

Expand All @@ -112,7 +127,13 @@ describe('OrderTable', () => {

expect(referenceRow).toHaveTextContent('Reference')
expect(referenceRow).toHaveTextContent('ref')
expect(screen.getAllByTestId(dataTableLocators.dataRow)).toHaveLength(9)

expect(icebergPeakRow).toHaveTextContent('Peak size')
expect(icebergPeakRow).toHaveTextContent('2')

expect(icebergMinRow).toHaveTextContent('Minimum visible size')
expect(icebergMinRow).toHaveTextContent('1')
expect(screen.getAllByTestId(dataTableLocators.dataRow)).toHaveLength(11)
})

it('renders fields that are provided from the API', () => {
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/receipts/utils/order-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ export const OrderTable = (properties: OrderTableProperties) => {
props: ['marketId'],
render: (icebergOptions, { marketId }) => [
'Peak size',
<OrderSize key="order-details-iceberg" size={icebergOptions.peakSize} marketId={marketId} />
<OrderSize key="order-details-iceberg-peak" size={icebergOptions.peakSize} marketId={marketId} />
]
},
{
prop: 'icebergOpts',
props: ['marketId'],
render: (icebergOptions, { marketId }) => [
'Minimum visible size',
<OrderSize key="order-details-iceberg" size={icebergOptions.minimumVisibleSize} marketId={marketId} />
<OrderSize key="order-details-iceberg-minimum" size={icebergOptions.minimumVisibleSize} marketId={marketId} />
]
}
]
Expand Down
4 changes: 2 additions & 2 deletions frontend/lib/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,6 @@ export interface TransactionMessage {
}

export type IcebergOptions = {
peakSize: number
minimumVisibleSize: number
peakSize: string
minimumVisibleSize: string
}

0 comments on commit 31de4d2

Please sign in to comment.