Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alecf committed Feb 12, 2019
1 parent 5ef3fff commit def24c8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/table/test/editableCellTests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,17 @@ describe("<EditableCell>", () => {
const elem = mount(<EditableCell wrapText={true} />);
expect(elem.find(`.${Classes.TABLE_NO_WRAP_TEXT}`).exists()).to.be.false;
});

it("Passes props to inner EditableText", () => {
const elem = mount(<EditableCell
editableTextProps={{ placeholder: 'Text if blank', value: 'Should not pass' }}
value="editable value" />);
elem.setState({ isEditing: true });
const input = elem.find('input');
// input props that EditableCell does not care about should pass through unchanged
expect(input.prop('placeholder')).to.equal('Text if blank');

// But special values should be overridden by EditableCell
expect(input.prop('value')).to.equal('editable value');
});
});

0 comments on commit def24c8

Please sign in to comment.