Skip to content

Commit

Permalink
Remove alert role from info banner (#3142)
Browse files Browse the repository at this point in the history
Co-authored-by: Iain Cattermole <[email protected]>
  • Loading branch information
Iain530 and Iain530 authored Jan 9, 2024
1 parent b320646 commit c946189
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ describe('BpkInfoBanner', () => {
message={message}
/>,
);
expect(screen.getByRole('alert')).toHaveClass('custom-banner-class-name');
expect(screen.getByRole('presentation')).toHaveClass('custom-banner-class-name');
});
});
7 changes: 0 additions & 7 deletions packages/bpk-component-info-banner/src/BpkInfoBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@
import type { CommonProps } from './common-types';
import BpkInfoBannerInner from './BpkInfoBannerInner';

const defaultProps = {
animateOnEnter: false,
animateOnLeave: false,
show: true,
icon: null,
};

const BpkInfoBanner = ({
animateOnEnter = false,
animateOnLeave = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import type {
CommonProps,
OnDismissHandler,
OnExpandToggleHandler,
StyleTypeValue,
ExpandableBannerAction,
} from './common-types';
import { ALERT_TYPES, STYLE_TYPES } from './common-types';
Expand Down Expand Up @@ -189,7 +188,7 @@ const BpkInfoBannerInner = ({
show={show}
{...rest}
>
<section className={sectionClassNames} role="alert">
<section className={sectionClassNames} role="presentation">
<div
role={isExpandable ? 'button' : undefined}
className={headerClassNames}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports[`BpkInfoBanner should render correctly 1`] = `
<div>
<section
class="bpk-info-banner bpk-info-banner--success bpk-info-banner--style-default"
role="alert"
role="presentation"
>
<div
class="bpk-info-banner__header"
Expand Down Expand Up @@ -68,7 +68,7 @@ exports[`BpkInfoBanner should render correctly with no type specified 1`] = `
<div>
<section
class="bpk-info-banner bpk-info-banner--info bpk-info-banner--style-default"
role="alert"
role="presentation"
>
<div
class="bpk-info-banner__header"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports[`BpkInfoBannerDismissable should render correctly 1`] = `
<div>
<section
class="bpk-info-banner bpk-info-banner--success bpk-info-banner--style-default"
role="alert"
role="presentation"
>
<div
class="bpk-info-banner__header"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports[`BpkInfoBannerInner should render correctly with "style" attribute equal
<div>
<section
class="bpk-info-banner bpk-info-banner--info bpk-info-banner--style-onContrast"
role="alert"
role="presentation"
>
<div
class="bpk-info-banner__header"
Expand Down Expand Up @@ -66,7 +66,7 @@ exports[`BpkInfoBannerInner should render correctly with "type" attribute equal
<div>
<section
class="bpk-info-banner bpk-info-banner--error bpk-info-banner--style-default"
role="alert"
role="presentation"
>
<div
class="bpk-info-banner__header"
Expand Down Expand Up @@ -123,7 +123,7 @@ exports[`BpkInfoBannerInner should render correctly with "type" attribute equal
<div>
<section
class="bpk-info-banner bpk-info-banner--error bpk-info-banner--style-default"
role="alert"
role="presentation"
>
<div
class="bpk-info-banner__header"
Expand Down Expand Up @@ -180,7 +180,7 @@ exports[`BpkInfoBannerInner should render correctly with "type" attribute equal
<div>
<section
class="bpk-info-banner bpk-info-banner--info bpk-info-banner--style-default"
role="alert"
role="presentation"
>
<div
class="bpk-info-banner__header"
Expand Down Expand Up @@ -237,7 +237,7 @@ exports[`BpkInfoBannerInner should render correctly with "type" attribute equal
<div>
<section
class="bpk-info-banner bpk-info-banner--success bpk-info-banner--style-default"
role="alert"
role="presentation"
>
<div
class="bpk-info-banner__header"
Expand Down Expand Up @@ -294,7 +294,7 @@ exports[`BpkInfoBannerInner should render correctly with "type" attribute equal
<div>
<section
class="bpk-info-banner bpk-info-banner--warning bpk-info-banner--style-default"
role="alert"
role="presentation"
>
<div
class="bpk-info-banner__header"
Expand Down Expand Up @@ -351,7 +351,7 @@ exports[`BpkInfoBannerInner should render correctly with a custom banner-alert c
<div>
<section
class="bpk-info-banner bpk-info-banner--warning bpk-info-banner--style-default custom-class"
role="alert"
role="presentation"
>
<div
class="bpk-info-banner__header"
Expand Down Expand Up @@ -409,7 +409,7 @@ exports[`BpkInfoBannerInner should render correctly with a custom class name 1`]
<div>
<section
class="bpk-info-banner bpk-info-banner--warning bpk-info-banner--style-default"
role="alert"
role="presentation"
>
<div
class="bpk-info-banner__header"
Expand Down Expand Up @@ -466,7 +466,7 @@ exports[`BpkInfoBannerInner should render correctly with a element based message
<div>
<section
class="bpk-info-banner bpk-info-banner--success bpk-info-banner--style-default"
role="alert"
role="presentation"
>
<div
class="bpk-info-banner__header bpk-info-banner__header--expandable"
Expand Down Expand Up @@ -558,7 +558,7 @@ exports[`BpkInfoBannerInner should render correctly with animateOnLeave 1`] = `
<div>
<section
class="bpk-info-banner bpk-info-banner--warning bpk-info-banner--style-default"
role="alert"
role="presentation"
>
<div
class="bpk-info-banner__header"
Expand Down Expand Up @@ -637,7 +637,7 @@ exports[`BpkInfoBannerInner should render correctly with arbitrary props 1`] = `
<div>
<section
class="bpk-info-banner bpk-info-banner--warning bpk-info-banner--style-default"
role="alert"
role="presentation"
>
<div
class="bpk-info-banner__header"
Expand Down Expand Up @@ -694,7 +694,7 @@ exports[`BpkInfoBannerInner should render correctly with child nodes 1`] = `
<div>
<section
class="bpk-info-banner bpk-info-banner--success bpk-info-banner--style-default"
role="alert"
role="presentation"
>
<div
class="bpk-info-banner__header bpk-info-banner__header--expandable"
Expand Down Expand Up @@ -781,7 +781,7 @@ exports[`BpkInfoBannerInner should render correctly with dismissable option 1`]
<div>
<section
class="bpk-info-banner bpk-info-banner--warning bpk-info-banner--style-default"
role="alert"
role="presentation"
>
<div
class="bpk-info-banner__header"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports[`withBannerAlertState(BpkInfoBannerDismissable) should render correctly
<div>
<section
class="bpk-info-banner bpk-info-banner--success bpk-info-banner--style-default"
role="alert"
role="presentation"
>
<div
class="bpk-info-banner__header"
Expand Down Expand Up @@ -88,7 +88,7 @@ exports[`withBannerAlertState(BpkInfoBannerExpandable) should render correctly c
<div>
<section
class="bpk-info-banner bpk-info-banner--success bpk-info-banner--style-default"
role="alert"
role="presentation"
>
<div
class="bpk-info-banner__header bpk-info-banner__header--expandable"
Expand Down Expand Up @@ -180,7 +180,7 @@ exports[`withBannerAlertState(BpkInfoBannerExpandable) should render correctly e
<div>
<section
class="bpk-info-banner bpk-info-banner--success bpk-info-banner--style-default"
role="alert"
role="presentation"
>
<div
class="bpk-info-banner__header bpk-info-banner__header--expandable"
Expand Down

0 comments on commit c946189

Please sign in to comment.