diff --git a/src/feedback/AlertMessage.jsx b/src/feedback/AlertMessage.jsx index 4c293301c..f9f667736 100644 --- a/src/feedback/AlertMessage.jsx +++ b/src/feedback/AlertMessage.jsx @@ -1,6 +1,6 @@ import React, { useCallback } from 'react'; import PropTypes from 'prop-types'; -import { StatusAlert } from '@edx/paragon'; +import { Alert } from '@edx/paragon'; import { ALERT_TYPES, MESSAGE_TYPES } from './data/constants'; // Put in a message type, get an alert type. @@ -18,13 +18,13 @@ const AlertMessage = (props) => { } = props; const statusAlertProps = { - alertType: ALERT_TYPES.WARNING, + variant: ALERT_TYPES.WARNING, onClose: useCallback(() => { closeHandler(id); }), - open: true, + show: true, }; if (messageType !== null && severityMap[messageType] !== undefined) { - statusAlertProps.alertType = severityMap[messageType]; + statusAlertProps.variant = severityMap[messageType]; } // The user message can be a @@ -42,7 +42,11 @@ const AlertMessage = (props) => { statusAlertProps.dialog = userMessage; } - return ; + return ( + + {statusAlertProps.dialog} + + ); }; AlertMessage.propTypes = { diff --git a/src/feedback/AlertMessage.test.jsx b/src/feedback/AlertMessage.test.jsx index 26c778028..e5f179b4d 100644 --- a/src/feedback/AlertMessage.test.jsx +++ b/src/feedback/AlertMessage.test.jsx @@ -21,7 +21,7 @@ describe('AlertMessage', () => { ); const wrapper = mount(component); - wrapper.find('button.close').simulate('click'); + wrapper.find('.btn').simulate('click'); expect(closeHandlerMock).toHaveBeenCalledWith(123); }); diff --git a/src/feedback/__snapshots__/AlertList.test.jsx.snap b/src/feedback/__snapshots__/AlertList.test.jsx.snap index e54886bc6..360eed45c 100644 --- a/src/feedback/__snapshots__/AlertList.test.jsx.snap +++ b/src/feedback/__snapshots__/AlertList.test.jsx.snap @@ -5,166 +5,200 @@ exports[`AlertList should be null by default 1`] = `null`; exports[`AlertList should render messages of each type 1`] = ` Array [ , , , , , , ] diff --git a/src/feedback/__snapshots__/AlertMessage.test.jsx.snap b/src/feedback/__snapshots__/AlertMessage.test.jsx.snap index b7c5d4428..cc56b4220 100644 --- a/src/feedback/__snapshots__/AlertMessage.test.jsx.snap +++ b/src/feedback/__snapshots__/AlertMessage.test.jsx.snap @@ -2,88 +2,113 @@ exports[`AlertMessage should default its severity when necessary 1`] = ` `; exports[`AlertMessage should render a userMessage element 1`] = ` `; exports[`AlertMessage should render a userMessage function 1`] = ` `; diff --git a/src/payment/__snapshots__/PaymentPage.test.jsx.snap b/src/payment/__snapshots__/PaymentPage.test.jsx.snap index c230132c3..8fd06081f 100644 --- a/src/payment/__snapshots__/PaymentPage.test.jsx.snap +++ b/src/payment/__snapshots__/PaymentPage.test.jsx.snap @@ -201,71 +201,89 @@ exports[` Renders correctly in various states should render all c > Array [ , , ]