From 23507da59a0068e5d636aead132e647340e96d7b Mon Sep 17 00:00:00 2001 From: damencho Date: Fri, 10 Jul 2020 10:28:57 -0500 Subject: [PATCH] feat: Adds id to the notifications so we can check for them in the integration tests. --- .../notifications/components/AbstractNotification.js | 12 ++++++++++++ .../notifications/components/web/Notification.js | 11 +++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/react/features/notifications/components/AbstractNotification.js b/react/features/notifications/components/AbstractNotification.js index 8b0709295a..2087cf92f7 100644 --- a/react/features/notifications/components/AbstractNotification.js +++ b/react/features/notifications/components/AbstractNotification.js @@ -148,6 +148,18 @@ export default class AbstractNotification extends Component

{ return descriptionArray; } + _getDescriptionKey: () => string + + /** + * Returns the description key that was used if any. + * + * @protected + * @returns {string} + */ + _getDescriptionKey() { + return this.props.descriptionKey; + } + _onDismissed: () => void; /** diff --git a/react/features/notifications/components/web/Notification.js b/react/features/notifications/components/web/Notification.js index 70e0104dea..70b8cb24cb 100644 --- a/react/features/notifications/components/web/Notification.js +++ b/react/features/notifications/components/web/Notification.js @@ -68,6 +68,8 @@ class Notification extends AbstractNotification { _getDescription: () => Array + _getDescriptionKey: () => string + _onDismissed: () => void; /** @@ -78,11 +80,12 @@ class Notification extends AbstractNotification { * @returns {ReactElement} */ _renderDescription() { + const description = this._getDescription(); + + // the id is used for testing the UI return ( -

- { - this._getDescription() - } +
+ { description }
); }