Skip to content

Commit

Permalink
FP-990: Fix failing ManageAccount test
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyboar committed Sep 27, 2021
1 parent ef525f4 commit ff2a61e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ describe('Manage Account Page', () => {
expect(getByText(/Manage Account/)).toBeInTheDocument();
expect(getByText(/Back to Dashboard/)).toBeInTheDocument();
expect(getAllByText(/Loading.../)).toBeDefined();
expect(getByRole('alert', {class: /introMessageGeneral/i})).toBeInTheDocument();
expect(getByRole('status', {name: 'message'})).toBeInTheDocument();
});
});
1 change: 1 addition & 0 deletions client/src/components/_common/IntroMessage/IntroMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ function IntroMessage({ children, className, messageName }) {

return (
<Message
aria-label={messageName}
type="info"
scope="section"
canDismiss
Expand Down
5 changes: 5 additions & 0 deletions client/src/components/_common/Message/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const DEFAULT_SCOPE = 'inline'; // FAQ: Historical support for default
* <Sample jsx>
*/
const Message = ({
ariaLabel,
children,
className,
dataTestid,
Expand Down Expand Up @@ -122,6 +123,7 @@ const Message = ({
className={className}
role={role}
in={isVisible}
aria-label={ariaLabel}
data-testid={dataTestid}
>
<Icon styleName="icon type-icon" name={iconName}>
Expand All @@ -144,6 +146,8 @@ const Message = ({
);
};
Message.propTypes = {
/** How to label this message for accessibility (via `aria-label`) */
ariaLabel: PropTypes.string,
/** Whether an action can be dismissed (requires scope equals `section`) */
canDismiss: PropTypes.bool,
/** Message text (as child node) */
Expand All @@ -163,6 +167,7 @@ Message.propTypes = {
type: PropTypes.oneOf(TYPES).isRequired
};
Message.defaultProps = {
ariaLabel: 'message',
className: '',
canDismiss: false,
dataTestid: '',
Expand Down

0 comments on commit ff2a61e

Please sign in to comment.