-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ffe-buttons-react): Inline expand button
This version introduces a React implementation of the inline expand button. The component is meant to be used at the end of a paragraph where other related paragraphs start off hidden. Clicking the button should expand the hidden paragraphs. Composing this functionality is left to the consumer. See InlineExpandButton.md for an example implementation.
- Loading branch information
Showing
16 changed files
with
228 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,17 @@ | ||
/*eslint-env mocha */ | ||
import React from 'react'; | ||
import { expect } from 'chai'; | ||
import { shallow } from 'enzyme'; | ||
|
||
import { BackButton } from './index'; | ||
|
||
describe('BackButton', () => { | ||
it('renders a back button', () => { | ||
const button = shallow(<BackButton />); | ||
|
||
expect(button).to.have.prop('buttonType', 'back'); | ||
expect(button).to.have.descendants('.ffe-back-button__label'); | ||
expect(button.props()).toHaveProperty('buttonType', 'back'); | ||
expect(button.find('.ffe-back-button__label').exists()).toBe(true); | ||
}); | ||
|
||
it('passes any prop on to Button', () => { | ||
const button = shallow(<BackButton disableButton={true} />); | ||
|
||
expect(button).to.have.attr('disabled'); | ||
expect(button.dive().props()).toHaveProperty('disabled', true); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.