Browse Source

feat: Adds id to the notifications so we can check for them in the integration tests.

master
damencho 5 years ago
parent
commit
23507da59a

+ 12
- 0
react/features/notifications/components/AbstractNotification.js View File

148
         return descriptionArray;
148
         return descriptionArray;
149
     }
149
     }
150
 
150
 
151
+    _getDescriptionKey: () => string
152
+
153
+    /**
154
+     * Returns the description key that was used if any.
155
+     *
156
+     * @protected
157
+     * @returns {string}
158
+     */
159
+    _getDescriptionKey() {
160
+        return this.props.descriptionKey;
161
+    }
162
+
151
     _onDismissed: () => void;
163
     _onDismissed: () => void;
152
 
164
 
153
     /**
165
     /**

+ 7
- 4
react/features/notifications/components/web/Notification.js View File

68
 
68
 
69
     _getDescription: () => Array<string>
69
     _getDescription: () => Array<string>
70
 
70
 
71
+    _getDescriptionKey: () => string
72
+
71
     _onDismissed: () => void;
73
     _onDismissed: () => void;
72
 
74
 
73
     /**
75
     /**
78
      * @returns {ReactElement}
80
      * @returns {ReactElement}
79
      */
81
      */
80
     _renderDescription() {
82
     _renderDescription() {
83
+        const description = this._getDescription();
84
+
85
+        // the id is used for testing the UI
81
         return (
86
         return (
82
-            <div>
83
-                {
84
-                    this._getDescription()
85
-                }
87
+            <div id = { this._getDescriptionKey() || description || this.props.titleKey || this.props.title } >
88
+                { description }
86
             </div>
89
             </div>
87
         );
90
         );
88
     }
91
     }

Loading…
Cancel
Save