Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

Commit

Permalink
Merge eceb649 into 0ab9c67
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpessoajr committed Sep 24, 2018
2 parents 0ab9c67 + eceb649 commit 4c51faa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/elements/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface Table<T> extends React.HTMLProps<T> {
isBordered?: boolean;
isStriped?: boolean;
isNarrow?: boolean;
isHoverable?: boolean;
}

export function Table(props: Table<HTMLElement>) {
Expand All @@ -16,13 +17,15 @@ export function Table(props: Table<HTMLElement>) {
'is-bordered': props.isBordered,
'is-narrow': props.isNarrow,
'is-striped': props.isStriped,
'is-hoverable': props.isHoverable,
},
props.className,
);
const {
isBordered,
isStriped,
isNarrow,
isHoverable,
...HTMLProps,
} = props;

Expand Down
6 changes: 6 additions & 0 deletions test/elements/Table.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,10 @@ describe('Table', () => {
expect(component.hasClass('table')).toBe(true);
expect(component.hasClass('custom')).toBe(true);
});

it('should render a table with .table and .is-hoverable', () => {
const component = shallow(<Table isHoverable />);
expect(component.hasClass('table')).toBe(true);
expect(component.hasClass('is-hoverable')).toBe(true);
});
});

0 comments on commit 4c51faa

Please sign in to comment.