Skip to content

Commit

Permalink
update breadcrumb spread
Browse files Browse the repository at this point in the history
  • Loading branch information
jbadan committed Jan 16, 2019
1 parent 00d5fd7 commit 0d8c5b6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/Breadcrumb/Breadcrumb.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import React from 'react';
import PropTypes from 'prop-types';
import { BrowserRouter, Link } from 'react-router-dom';

export const Breadcrumb = props => {
const { children } = props;
return <ul className='fd-breadcrumb'>{children}</ul>;
export const Breadcrumb = ({ children, ...props }) => {
return <ul className='fd-breadcrumb' {...props}>{children}</ul>;
};

Breadcrumb.propTypes = {
Expand Down
8 changes: 6 additions & 2 deletions src/Breadcrumb/Breadcrumb.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ describe('<Breadcrumb />', () => {
});

describe('Prop spreading', () => {
xtest('should allow props to be spread to the Breadcrumb component', () => {
// TODO: placeholder for this test description once that functionality is built
test('should allow props to be spread to the Breadcrumb component', () => {
const element = mount(<Breadcrumb data-sample='Sample' />);

expect(
element.getDOMNode().attributes['data-sample'].value
).toBe('Sample');
});

test('should allow props to be spread to the BreadcrumbItem component', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/Breadcrumb/__snapshots__/Breadcrumb.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`<Breadcrumb /> create breadcrumbs using router links 1`] = `
<ul
className="fd-breadcrumb"
className="blue"
>
<li
className="fd-breadcrumb__item blue"
Expand Down

0 comments on commit 0d8c5b6

Please sign in to comment.