Skip to content

Commit

Permalink
chore(suiteheader and headeraction): fix accessibility scan violations
Browse files Browse the repository at this point in the history
  • Loading branch information
kalyanixraut committed Jun 21, 2023
1 parent c8021cb commit afddacb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
16 changes: 5 additions & 11 deletions packages/react/src/components/Header/Header.test.e2e.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ describe(
cy.findByLabelText('Announcements').should('not.exist');
cy.findByRole('button', { name: 'help' }).should('not.exist');
cy.findByRole('button', { name: 'open and close list of options' }).click();
cy.findByRole('button', { name: 'Announcements', label: 'Announcements' })
cy.findByRole('menuitem', { name: 'Announcements' })
.should('be.visible')
.click()
.should(() => {
Expand Down Expand Up @@ -251,9 +251,7 @@ describe(
cy.findByRole('button', { name: 'open and close list of options' }).click(5, 5, {
force: true,
});
cy.findByRole('button', { name: 'Announcements', label: 'Announcements' }).should(
'be.visible'
);
cy.findByRole('menuitem', { name: 'Announcements' }).should('be.visible');
});

it('should hide header action actions in a small viewport in RTL', () => {
Expand Down Expand Up @@ -281,7 +279,7 @@ describe(
cy.findByLabelText('Announcements').should('not.exist');
cy.findByRole('button', { name: 'help' }).should('not.exist');
cy.findByRole('button', { name: 'open and close list of options' }).click();
cy.findByRole('button', { name: 'Announcements', label: 'Announcements' })
cy.findByRole('menuitem', { name: 'Announcements' })
.should('be.visible')
.click()
.should(() => {
Expand All @@ -306,9 +304,7 @@ describe(
mount(<Header {...commonProps} isActionItemVisible={isActionItemVisible} />);

cy.findByRole('button', { name: 'open and close list of options' }).click();
cy.findByRole('button', { name: 'Announcements', label: 'Announcements' }).should(
'be.visible'
);
cy.findByRole('menuitem', { name: 'Announcements' }).should('be.visible');
cy.findByRole('button', { name: 'Custom icon 1', label: 'Custom icon 1' }).should(
'not.exist'
);
Expand All @@ -329,9 +325,7 @@ describe(
mount(<Header {...commonProps} />);

cy.findByRole('button', { name: 'open and close list of options' }).click();
cy.findByRole('button', { name: 'Announcements', label: 'Announcements' }).should(
'be.visible'
);
cy.findByRole('menuitem', { name: 'Announcements' }).should('be.visible');
// I don't know if this is actually necessary in cypress, but just to be safe.
cy.window().then((win) => {
Object.defineProperty(win, 'innerWidth', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ describe('PageTitleBar', () => {
.should(
'have.attr',
'style',
'--header-offset:48px; --negative-header-offset:-48px; --scroll-transition-progress:1;'
'--header-offset: 48px; --negative-header-offset: -48px; --scroll-transition-progress: 1;'
);
});

Expand Down Expand Up @@ -174,7 +174,7 @@ describe('PageTitleBar', () => {
.should(
'have.attr',
'style',
'--header-offset:40px; --negative-header-offset:-40px; --scroll-transition-progress:1;'
'--header-offset: 40px; --negative-header-offset: -40px; --scroll-transition-progress: 1;'
);

breadcrumbsAndTabsAreStickyAndInTheCorrectPosition();
Expand Down Expand Up @@ -216,7 +216,7 @@ describe('PageTitleBar', () => {
.should(
'have.attr',
'style',
'--header-offset:40px; --negative-header-offset:-40px; --scroll-transition-progress:1;'
'--header-offset: 40px; --negative-header-offset: -40px; --scroll-transition-progress: 1;'
);

cy.scrollTo(0, 50);
Expand Down Expand Up @@ -270,7 +270,7 @@ describe('PageTitleBar', () => {
.should(
'have.attr',
'style',
'--header-offset: 0px; --negative-header-offset: 0px; --scroll-transition-progress: 0;'
'--header-offset: 0px; --negative-header-offset: -0px; --scroll-transition-progress: 0;'
);

cy.scrollTo(0, 250);
Expand All @@ -281,7 +281,7 @@ describe('PageTitleBar', () => {
.should(
'have.attr',
'style',
'--header-offset:0px; --negative-header-offset:0px; --scroll-transition-progress:1;'
'--header-offset: 0px; --negative-header-offset: 0px; --scroll-transition-progress: 1;'
);

tabsAreStickyAndBreadcrumbsAreHidden();
Expand Down

0 comments on commit afddacb

Please sign in to comment.