@@ -13,6 +13,7 @@ import {
1313} from 'mock-builders' ;
1414
1515import { getDisplayImage , getDisplayTitle , getLatestMessagePreview } from '../utils' ;
16+ import { generateStaticLocationResponse } from '../../../mock-builders' ;
1617
1718describe ( 'ChannelPreview utils' , ( ) => {
1819 const clientUser = generateUser ( ) ;
@@ -37,6 +38,15 @@ describe('ChannelPreview utils', () => {
3738 const channelWithDeletedMessage = generateChannel ( {
3839 messages : [ generateMessage ( { deleted_at : new Date ( ) } ) ] ,
3940 } ) ;
41+ const channelWithLocationMessage = generateChannel ( {
42+ messages : [
43+ generateMessage ( {
44+ attachments : [ ] ,
45+ shared_location : generateStaticLocationResponse ( ) ,
46+ text : '' ,
47+ } ) ,
48+ ] ,
49+ } ) ;
4050 const channelWithAttachmentMessage = generateChannel ( {
4151 messages : [
4252 generateMessage ( {
@@ -50,6 +60,7 @@ describe('ChannelPreview utils', () => {
5060 [ 'Nothing yet...' , 'channelWithEmptyMessage' , channelWithEmptyMessage ] ,
5161 [ 'Message deleted' , 'channelWithDeletedMessage' , channelWithDeletedMessage ] ,
5262 [ '🏙 Attachment...' , 'channelWithAttachmentMessage' , channelWithAttachmentMessage ] ,
63+ [ '🧭 Live location' , 'channelWithLocationMessage' , channelWithLocationMessage ] ,
5364 ] ) ( 'should return %s for %s' , async ( expectedValue , testCaseName , c ) => {
5465 const t = ( text ) => text ;
5566 const channel = await getQueriedChannelInstance ( c ) ;
0 commit comments