Skip to content

Commit 2ee5117

Browse files
cdcabreradtaylor113
authored andcommitted
fix(CardDropdownButton): Allow props to be passed (#932)
1 parent 60c1067 commit 2ee5117

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

packages/patternfly-3/patternfly-react/src/components/Cards/CardDropdownButton.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const CardDropdownButton = ({ id, children, title, className, pullRight, ...prop
88
const classes = classNames('card-pf-time-frame-filter', className);
99
const CustomButtonGroup = customGroup => <ButtonGroup {...customGroup} bsClass=" " />;
1010
return (
11-
<Dropdown className={classes} id={id} pullRight={pullRight} componentClass={CustomButtonGroup}>
11+
<Dropdown className={classes} id={id} pullRight={pullRight} componentClass={CustomButtonGroup} {...props}>
1212
<Dropdown.Toggle>{title}</Dropdown.Toggle>
1313
<Dropdown.Menu>{children}</Dropdown.Menu>
1414
</Dropdown>

packages/patternfly-3/patternfly-react/src/components/Cards/Cards.test.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,17 @@ test('Card Link is working properly', () => {
5454
});
5555

5656
test('Card Drop Down Button is working properly', () => {
57+
const onClick = jest.fn();
5758
const component = mount(
58-
<CardDropdownButton id="cardDropdownButton1" title="Last 30 Days" onClick={jest.fn()}>
59+
<CardDropdownButton id="cardDropdownButton1" title="Last 30 Days" onClick={onClick}>
5960
<MenuItem eventKey="1" active>
6061
Last 30 Days
6162
</MenuItem>
6263
</CardDropdownButton>
6364
);
6465

66+
component.find('button').simulate('click');
67+
68+
expect(onClick).toHaveBeenCalled();
6569
expect(component.render()).toMatchSnapshot();
6670
});

packages/patternfly-3/patternfly-react/src/components/Cards/__snapshots__/Cards.test.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ exports[`Card Body is working properly 1`] = `
1010

1111
exports[`Card Drop Down Button is working properly 1`] = `
1212
<div
13-
class="card-pf-time-frame-filter dropdown "
13+
class="card-pf-time-frame-filter dropdown open "
1414
>
1515
<button
16-
aria-expanded="false"
16+
aria-expanded="true"
1717
aria-haspopup="true"
1818
class="dropdown-toggle btn btn-default"
1919
id="cardDropdownButton1"

0 commit comments

Comments
 (0)