Skip to content

Commit

Permalink
chore: add columns test
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahgm committed Nov 11, 2022
1 parent f9edddd commit c62a26b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions packages/components/src/Columns/Columns.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,13 @@ test('supports stretching to full height', () => {
const container = screen.getByTestId(/columns/);
expect(container).toHaveStyle(`height: 100%`);
});

test('does work with non react elements', () => {
render(
<Columns columns={[1]} data-testid="columns">
hello
</Columns>
);
const container = screen.getByTestId(/columns/);
expect(container).toHaveTextContent('hello');
});
2 changes: 1 addition & 1 deletion packages/components/src/Columns/Columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const Columns = ({
flexGrow: columns[idx],
}}
>
{isValidElement(child) ? cloneElement(child) : null}
{isValidElement(child) ? cloneElement(child) : child}
</Box>
))}
</Box>
Expand Down

0 comments on commit c62a26b

Please sign in to comment.