Skip to content

Commit

Permalink
fix(sidebar): Don't display @mentions without getMentionWithQuery prop (
Browse files Browse the repository at this point in the history
  • Loading branch information
pramodsum authored Jan 18, 2019
1 parent e7880a3 commit ba8c418
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class ApprovalCommentForm extends React.Component<Props, State> {
approverSelectorContacts,
className,
createTask,
getMentionWithQuery = noop,
getMentionWithQuery,
intl: { formatMessage },
isDisabled,
isOpen,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,17 @@ describe('elements/content-sidebar/ActivityFeed/approval-comment-form/ApprovalCo
expect(content).toEqual('');
});

test('should not display trigger @mention selector when getMentionQuery prop is empty', () => {
const wrapper = render({ getMentionWithQuery: null });

expect(
wrapper
.find('DraftJSMentionSelector')
.at(0)
.prop('onMention'),
).toEqual(null);
});

describe('handleApproverSelectorInput()', () => {
test('should call getApproverWithQuery() when called', () => {
const value = 'test';
Expand Down

0 comments on commit ba8c418

Please sign in to comment.