-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Description
Hi and thanks for this beautiful package. I'm having trouble with unit testing of my component which uses vertical steps. Here is a simple demonstration:
import { Box, ChakraProvider } from "@chakra-ui/react";
import { render } from "@testing-library/react";
import { Steps, Step } from "chakra-ui-steps";
import { theme } from "../../../../ui/components/Layout/Theme/theme";
import { Modal } from "./Modal";
describe("Feature: Wallet", () => {
describe("Component: ConnectionModal/Modal", () => {
const onClickSpy = jest.fn();
describe("Scenario: CheckWallet", () => {
it("should show correct step", () => {
// Arrange
// Act
const { debug } = render(
<Box>
<Steps colorScheme="green" activeStep={0} orientation="vertical">
<Step label="Step 1" />
<Step label="Step 2" />
<Step label="Step 3" />
</Steps>
</Box>
);
// Assert
});
});
});
});This test fails with the famous error: TypeError: Cannot read properties of undefined (reading 'width')
But if I only remove orientation="vertical" or make it orientation="horizontal", it works fine. Steps is correctly defined in my theme configuration on both application and test-utils file.
Metadata
Metadata
Assignees
Labels
No labels