Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

fix(Modal): fix button type in danger mode #2254

Merged
merged 3 commits into from
Apr 22, 2019
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions src/components/ComposedModal/ComposedModal-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ describe('<ModalFooter />', () => {
<ModalFooter secondaryButtonText="test" danger />
);

it('renders danger--primary button if primary text && danger', () => {
it('renders danger button if primary text && danger', () => {
const buttonComponent = primaryWrapper.find(Button);
expect(buttonComponent.exists()).toBe(true);
expect(buttonComponent.props().kind).toBe('danger--primary');
expect(buttonComponent.props().kind).toBe('danger');
});

it('renders tertiary button if secondary text && danger', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ComposedModal/ComposedModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ export class ModalFooter extends Component {
onClick={onRequestSubmit}
className={primaryClass}
disabled={primaryButtonDisabled}
kind={danger ? 'danger--primary' : 'primary'}
kind={danger ? 'danger' : 'primary'}
ref={this.props.inputref}>
{primaryButtonText}
</Button>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/Modal-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ describe('Danger Modal', () => {
expect(modalButtons[0].props.kind).toEqual(
!componentsX ? 'tertiary' : 'secondary'
);
expect(modalButtons[1].props.kind).toEqual('danger--primary');
expect(modalButtons[1].props.kind).toEqual('danger');
});
});
});
2 changes: 1 addition & 1 deletion src/components/Modal/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ export default class Modal extends Component {
{secondaryButtonText}
</Button>
<Button
kind={danger ? 'danger--primary' : 'primary'}
kind={danger ? 'danger' : 'primary'}
disabled={primaryButtonDisabled}
onClick={onRequestSubmit}
inputref={this.button}>
Expand Down