Skip to content

Commit

Permalink
gt - Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gthomas-appfolio committed Aug 31, 2018
1 parent df92d1c commit 9c8fa3c
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion test/components/UncontrolledTable.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,24 @@ describe('<UncontrolledTable />', () => {
assert.equal(ths.length, columns.length + 1); // For selectable column
});

it('should call onSelect when selectable row picked');
it('should call onSelect when selectable row picked', () => {
const columns = [{ header: 'Name', cell: row => row }];
const rows = ['Alpha', 'Bravo', 'Charlie', 'Delta', 'Echo', 'Foxtrot', 'Golf', 'Hotel'];
const onSelect = sinon.stub();
const wrapper = mount(
<UncontrolledTable
columns={columns}
rows={rows}
selectable
onSelect={onSelect}
/>
);
wrapper
.find({ type: 'checkbox' })
.first()
.simulate('change', { target: { checked: true } });
sinon.assert.calledWith(onSelect, rows);
});

it('should show correct rows when paginated specified', () => {
const columns = [{ header: 'Name', cell: row => row }];
Expand Down

0 comments on commit 9c8fa3c

Please sign in to comment.