Shared:Components:Box: fix tests
This commit is contained in:
parent
49b8dcbfc5
commit
57c507426d
@ -5,8 +5,8 @@ import "@testing-library/jest-dom";
|
||||
|
||||
import { Box } from ".";
|
||||
|
||||
test("<Box />", () => {
|
||||
render(<Box testId="test" />);
|
||||
test("<Box />: render without error", () => {
|
||||
render(<Box />);
|
||||
|
||||
expect(screen.queryByTestId("test")).toBeInTheDocument();
|
||||
expect(screen.queryByTestId("box")).toBeInTheDocument();
|
||||
});
|
||||
|
@ -66,5 +66,4 @@ export interface BoxProps {
|
||||
widthProp?: string;
|
||||
|
||||
children?: React.ReactNode;
|
||||
testId?: string;
|
||||
}
|
||||
|
@ -3,8 +3,8 @@ import { BoxProps } from "./Box.types";
|
||||
import { StyledBox } from "./Box.styled";
|
||||
|
||||
function Box(props: BoxProps) {
|
||||
const { as, testId } = props;
|
||||
return <StyledBox {...props} as={as || "div"} data-testid={testId} />;
|
||||
const { as } = props;
|
||||
return <StyledBox {...props} as={as || "div"} data-testid="box" />;
|
||||
}
|
||||
|
||||
Box.defaultProps = {
|
||||
|
Loading…
Reference in New Issue
Block a user