Skip to content

Commit

Permalink
Merge branch 'master' into alisonjoseph-patch-codeowners
Browse files Browse the repository at this point in the history
  • Loading branch information
asudoh authored Nov 18, 2019
2 parents c5df67f + 79be49d commit 4e0f72e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/react/src/components/Tab/Tab-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ describe('Tab', () => {
);
});

it('has aria-disabled that matches disabled', () => {
const getDisabledRegion = () => wrapper.find('[aria-disabled]');

expect(getDisabledRegion().length).toEqual(0);

wrapper.setProps({ disabled: true });
expect(getDisabledRegion().prop('aria-disabled')).toEqual(true);
});

it(`adds [className="${prefix}--tabs__nav-item--selected"] when selected prop is true`, () => {
wrapper.setProps({ selected: true });
expect(wrapper.hasClass(`${prefix}--tabs__nav-item--selected`)).toBe(
Expand Down Expand Up @@ -110,6 +119,7 @@ describe('Tab', () => {
});
});
});

describe('custom render label', () => {
const wrapper = mount(
<Tab
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/components/Tab/Tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export default class Tab extends React.Component {
role: 'tab',
tabIndex: !disabled ? tabIndex : -1,
['aria-selected']: selected,
['aria-disabled']: disabled,
ref: e => {
this.tabAnchor = e;
},
Expand Down

0 comments on commit 4e0f72e

Please sign in to comment.