@@ -154,4 +154,68 @@ describe('Call toast notification component', () => {
154
154
externalBadge = wrapper . find ( '.ext-badge-container' ) ;
155
155
expect ( externalBadge . exists ( ) ) . toBeTruthy ( ) ;
156
156
} ) ;
157
+
158
+ it ( 'should display check for new federation toast - Unknown User' , ( ) => {
159
+ const isExternal = true ;
160
+
161
+ ipcRenderer . send ( IPC_RENDERER_NOTIFICATION_DATA_CHANNEL , {
162
+ ...defaultProps ,
163
+ isExternal,
164
+ isFederatedEnabled : true ,
165
+ callerName : '' ,
166
+ callerNumber : '123' ,
167
+ primaryText : '123 [PHONE]' ,
168
+ } ) ;
169
+
170
+ let federationTypeText = wrapper . find ( '[data-testid="FEDERATION_TYPE"]' ) ;
171
+ let federationUnknownUserAvatar = wrapper . find (
172
+ '[data-testid="FEDERATION_UNKNOWN_USER_AVATAR"]' ,
173
+ ) ;
174
+ let federationPrimaryText = wrapper . find (
175
+ '[data-testid="CALL_NOTIFICATION_NAME"]' ,
176
+ ) ;
177
+ let avatarBadge = wrapper . find ( '[data-testid="AVATAR_BADGE"]' ) ;
178
+
179
+ expect ( federationTypeText . exists ( ) ) . toBeTruthy ( ) ;
180
+ expect ( federationUnknownUserAvatar . exists ( ) ) . toBeTruthy ( ) ;
181
+ expect ( federationPrimaryText . exists ( ) ) . toBeTruthy ( ) ;
182
+ expect ( avatarBadge . exists ( ) ) . toBeFalsy ( ) ;
183
+
184
+ expect ( federationPrimaryText . text ( ) ) . toBe ( '123 ' ) ;
185
+ expect ( federationTypeText . text ( ) ) . toBe ( 'SMS & Voice' ) ;
186
+ } ) ;
187
+
188
+ it ( 'should display check for new federation toast - Known User' , ( ) => {
189
+ const isExternal = true ;
190
+
191
+ ipcRenderer . send ( IPC_RENDERER_NOTIFICATION_DATA_CHANNEL , {
192
+ ...defaultProps ,
193
+ isExternal,
194
+ isFederatedEnabled : true ,
195
+ callerName : 'Helen' ,
196
+ callerNumber : '123' ,
197
+ primaryText : 'Helen' ,
198
+ } ) ;
199
+ let federationTypeText = wrapper . find ( '[data-testid="FEDERATION_TYPE"]' ) ;
200
+ let federationUnknownUserAvatar = wrapper . find (
201
+ '[data-testid="FEDERATION_NAMED_USER_AVATAR"]' ,
202
+ ) ;
203
+ let federationNumber = wrapper . find (
204
+ '[data-testid="FEDERATION_NAMED_USER_NUMBER"]' ,
205
+ ) ;
206
+ let federationPrimaryText = wrapper . find (
207
+ '[data-testid="CALL_NOTIFICATION_NAME"]' ,
208
+ ) ;
209
+ let avatarBadge = wrapper . find ( '[data-testid="AVATAR_BADGE"]' ) ;
210
+
211
+ expect ( federationTypeText . exists ( ) ) . toBeTruthy ( ) ;
212
+ expect ( federationUnknownUserAvatar . exists ( ) ) . toBeTruthy ( ) ;
213
+ expect ( federationPrimaryText . exists ( ) ) . toBeTruthy ( ) ;
214
+ expect ( avatarBadge . exists ( ) ) . toBeFalsy ( ) ;
215
+ expect ( federationNumber . exists ( ) ) . toBeTruthy ( ) ;
216
+
217
+ expect ( federationPrimaryText . text ( ) ) . toBe ( 'Helen' ) ;
218
+ expect ( federationTypeText . text ( ) ) . toBe ( 'SMS & Voice' ) ;
219
+ expect ( federationNumber . text ( ) ) . toBe ( '123' ) ;
220
+ } ) ;
157
221
} ) ;
0 commit comments