Skip to content

Commit

Permalink
[table] fix wrapText on EditableCell component (#2701)
Browse files Browse the repository at this point in the history
* fixes #2700: adds wrapText prop to Cell component

* lint test

* typo wrapsText should be wrapText in test descr

* make selector more specific
  • Loading branch information
face authored and giladgray committed Aug 1, 2018
1 parent 9a9dd7d commit 2c419d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/table/src/cell/editableCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export class EditableCell extends React.Component<IEditableCellProps, IEditableC
return (
<Cell
{...spreadableProps}
wrapText={wrapText}
truncated={false}
interactive={interactive}
cellRef={this.refHandlers.cell}
Expand Down
12 changes: 12 additions & 0 deletions packages/table/test/editableCellTests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,16 @@ describe("<EditableCell>", () => {
elem.find("input").simulate("blur");
expect(onChangeSpy.firstCall.args).to.deep.equal([CHANGED_VALUE, ROW_INDEX, COLUMN_INDEX]);
});

it("defaults to no wrapText", () => {
const elem = mount(<EditableCell />);

expect(elem.find(`.${Classes.TABLE_NO_WRAP_TEXT}`).children().length).to.equal(1);
});

it("wraps text when wrapText is true", () => {
const elem = mount(<EditableCell wrapText={true} />);

expect(elem.find(`.${Classes.TABLE_NO_WRAP_TEXT}`).children().length).to.equal(0);
});
});

1 comment on commit 2c419d4

@blueprint-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[table] fix wrapText on EditableCell component (#2701)

Preview: documentation | landing | table

Please sign in to comment.