Skip to content

Commit

Permalink
fix: πŸ› Table handling immutable options
Browse files Browse the repository at this point in the history
βœ… Closes: 137
  • Loading branch information
luciobordonaro committed Aug 13, 2020
1 parent 6bdd4da commit d730be0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/components/Table/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,15 @@ describe("Table test suite:", () => {
onSortChange: jest.fn(),
});
});

it("immutable options", () => {
const frozenRows = Object.freeze([
{ name: "Mosaic" },
{ name: "Murales" },
{ name: "Paintings" },
{ name: "Photography" },
{ name: "Sculpture" },
]) as { name: string }[];
getTableTestable({ ...defaultProps, rows: frozenRows });
});
});
2 changes: 1 addition & 1 deletion src/components/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const Table: FC<ITable> = ({
components={{
Action: (props: any) => actionComponentAdapter(props, dataCy),
}}
data={rows}
data={[...rows]}
data-cy={dataCy}
icons={{
Filter: iconAdapter(Icons.filter, IconSize.small),
Expand Down

0 comments on commit d730be0

Please sign in to comment.