Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prop spreading to breadcrumb #223

Merged
merged 2 commits into from
Jan 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 {...props} className='fd-breadcrumb'>{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