Skip to content

Commit

Permalink
Rename pui-btn--icon class name to pui-btn--icon-only [#164253492]
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Guerette <nguerette@pivotal.io>
  • Loading branch information
reidmit authored and nguerette committed Feb 26, 2019
1 parent c52719e commit 2823332
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions spec/pivotal-ui-react/alerts/alerts_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ describe('Alert Component', () => {

it('has a close button', () => {
expect('.pui-alert button').toHaveLength(1);
expect('.pui-btn--default.pui-btn--flat.pui-btn--icon').toHaveClass('pui-alert-close-btn');
expect('.pui-btn--default.pui-btn--flat.pui-btn--icon .icon-close').toExist();
expect('.pui-btn--default.pui-btn--flat.pui-btn--icon-only').toHaveClass('pui-alert-close-btn');
expect('.pui-btn--default.pui-btn--flat.pui-btn--icon-only .icon-close').toExist();
});

it('has an sr-only close button', () => {
Expand Down
10 changes: 7 additions & 3 deletions spec/pivotal-ui-react/buttons/buttons_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,15 @@ describe('UIButton', () => {

describe('when iconOnly is true', () => {
beforeEach(() => {
subject::setProps({iconOnly: true, 'aria-label': 'Large Button'});
subject::setProps({iconOnly: true, 'aria-label': 'Icon-only Button'});
});

it('adds the large button class', () => {
expect('button.pui-btn').toHaveClass('pui-btn--icon');
it('adds the appropriate button class', () => {
expect('button.pui-btn').toHaveClass('pui-btn--icon-only');
});

it('has the required aria-label attribute set', () => {
expect('button.pui-btn').toHaveAttr('aria-label', 'Icon-only Button');
});
});

Expand Down
2 changes: 1 addition & 1 deletion spec/pivotal-ui-react/flyout/flyout_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('Flyout', () => {
it('renders an icon button', () => {
expect('.pui-dialog .pui-flyout-icon-btn').toHaveClass('pui-btn--default');
expect('.pui-dialog .pui-flyout-icon-btn').toHaveClass('pui-btn--flat');
expect('.pui-dialog .pui-flyout-icon-btn').toHaveClass('pui-btn--icon');
expect('.pui-dialog .pui-flyout-icon-btn').toHaveClass('pui-btn--icon-only');
expect('.pui-dialog .pui-flyout-icon-btn').toHaveAttr('aria-label', 'Close');
expect(Icon).toHaveBeenRenderedWithProps({
src: 'chevron_left',
Expand Down
2 changes: 1 addition & 1 deletion spec/pivotal-ui-react/modal/modal_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('Modal', () => {
expect('.pui-dialog.pui-modal-dialog .pui-modal-close-btn').toHaveAttr('aria-label', 'Close');
expect('.pui-dialog.pui-modal-dialog .pui-modal-close-btn').toHaveClass('pui-btn--default');
expect('.pui-dialog.pui-modal-dialog .pui-modal-close-btn').toHaveClass('pui-btn--flat');
expect('.pui-dialog.pui-modal-dialog .pui-modal-close-btn').toHaveClass('pui-btn--icon');
expect('.pui-dialog.pui-modal-dialog .pui-modal-close-btn').toHaveClass('pui-btn--icon-only');
expect(Icon).toHaveBeenRenderedWithProps({src: 'close', size: 'inherit', style: {}, verticalAlign: 'middle'});
});

Expand Down
2 changes: 1 addition & 1 deletion src/react/buttons/buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class UIButton extends React.Component {
'pui-btn--flat': flat,
'pui-btn--lg': large,
'pui-btn--sm': small,
'pui-btn--icon': iconOnly,
'pui-btn--icon-only': iconOnly,
'pui-btn--icon-right': !!icon && iconPosition === 'right',
'pui-btn--full': fullWidth
}
Expand Down

0 comments on commit 2823332

Please sign in to comment.