Skip to content

Commit

Permalink
fix: accordion default panel ids
Browse files Browse the repository at this point in the history
  • Loading branch information
Chao Liang committed Jan 29, 2019
1 parent 17a1e56 commit 1a31757
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/adslot-ui/Accordion/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class AccordionComponent extends React.PureComponent {

static defaultProps = {
maxExpand: 'max',
defaultActivePanelIds: [],
};

state = {
Expand Down
11 changes: 11 additions & 0 deletions src/components/adslot-ui/Accordion/index.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ describe('AccordionComponent', () => {
expect(cardElement.children()).to.have.length(1);
});

it('should have default props', () => {
const wrapper = shallow(
<Accordion {...makeProps()}>
<Accordion.Panel {...panel1}>{panel1.content}</Accordion.Panel>
</Accordion>
);
const instance = wrapper.instance();
expect(instance.props.defaultActivePanelIds).to.eql([]);
expect(instance.props.maxExpand).to.equal('max');
});

it('should render with props', () => {
const wrapper = shallow(
<Accordion {...makeProps()}>
Expand Down

0 comments on commit 1a31757

Please sign in to comment.