Skip to content

Commit

Permalink
fix: unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SHolleworth committed Nov 7, 2024
1 parent 50bef17 commit 41ed9a4
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ describe("MainHeader", () => {
)

act(() => {
fireEvent.click(screen.getByTestId("toggleButton"))
fireEvent.click(screen.getByTestId("action-toggleTileView"))
})

expect(screen.getByTestId("tile-EURUSD").textContent).toBe(
"IsAnalytics: false",
)

act(() => {
fireEvent.click(screen.getByTestId("toggleButton"))
fireEvent.click(screen.getByTestId("action-toggleTileView"))
})

expect(screen.getByTestId("tile-EURUSD").textContent).toBe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const GridRegion = <Row extends Trade>({
<TradesStreamContext.Provider value={trades$}>
<HighlightedRowContext.Provider value={highlightedRow}>
<Region
aria-labelledby="trades-table-heading"
fallback={<Loader ariaLabel="Loading trades blotter" />}
Header={
<TradesHeader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { tradesMock } from "@/services/trades/__mocks__/_trades"
import FxTrades from "../CoreFxTrades"
import * as TableTrades from "../TradesState/tableTrades"

vi.mock("../TradesGrid/utils")
vi.mock("../GridRegion/utils")
vi.mock("@openfin/core", () => ({
fin: undefined,
}))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { tradesMock } from "@/services/trades/__mocks__/_trades"
import FxTrades from "../CoreFxTrades"
import * as TableTrades from "../TradesState/tableTrades"

vi.mock("../TradesGrid/utils")
vi.mock("../GridRegion/utils")
vi.mock("@openfin/core", () => ({
fin: undefined,
}))
Expand All @@ -30,7 +30,7 @@ vi.mock("../TradesState/tableTrades", async () => {
useFxTradeRowHighlight: vi.fn().mockReturnValue(undefined),
}
})
vi.mock("../TradesGrid/utils")
vi.mock("../GridRegion/utils")
vi.mock("react-virtualized-auto-sizer", () => ({
default: ({
children,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ vi.mock("../TradesState/tableTrades", async () => {
useFxTradeRowHighlight: vi.fn().mockReturnValue(undefined),
}
})
vi.mock("../TradesGrid/utils")
vi.mock("../GridRegion/utils")
vi.mock("react-virtualized-auto-sizer", () => ({
default: ({
children,
Expand Down
8 changes: 7 additions & 1 deletion packages/client/src/client/components/TabBar/TabBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@ export const TabBar = <T extends string>({
<RightSection>
{actions &&
actions.toReversed().map(({ name, active, onClick, inner, size }) => (
<Action key={name} active={!!active} onClick={onClick} size={size}>
<Action
key={name}
active={!!active}
onClick={onClick}
size={size}
data-testid={`action-${name}`}
>
{inner}
</Action>
))}
Expand Down

0 comments on commit 41ed9a4

Please sign in to comment.