add logic for tenor and giphy embeds
This commit is contained in:
@@ -421,6 +421,39 @@ describe('parseEmbedPlayerFromUrl', () => {
|
||||
|
||||
'https://vimeo.com/videoId',
|
||||
'https://vimeo.com/videoId?autoplay=0',
|
||||
|
||||
'https://giphy.com/gifs/some-random-gif-name-gifId',
|
||||
'https://giphy.com/gif/some-random-gif-name-gifId',
|
||||
'https://giphy.com/gifs/',
|
||||
|
||||
'https://media.giphy.com/media/gifId/giphy.gif',
|
||||
'https://media0.giphy.com/media/gifId/giphy.gif',
|
||||
'https://media1.giphy.com/media/gifId/giphy.gif',
|
||||
'https://media2.giphy.com/media/gifId/giphy.gif',
|
||||
'https://media3.giphy.com/media/gifId/giphy.gif',
|
||||
'https://media4.giphy.com/media/gifId/giphy.gif',
|
||||
'https://media5.giphy.com/media/gifId/giphy.gif',
|
||||
'https://media1.google.com/media/gifId/giphy.gif',
|
||||
|
||||
'https://media.giphy.com/media/trackingId/gifId/giphy.gif',
|
||||
|
||||
'https://i.giphy.com/media/gifId/giphy.gif',
|
||||
'https://i.giphy.com/media/gifId/giphy.gif',
|
||||
'https://i.giphy.com/gifId.gif',
|
||||
'https://i.giphy.com/gifId.gif',
|
||||
|
||||
'https://media1.tenor.com/m/gifId/someName.gif',
|
||||
'https://media.tenor.com/m/gifId/someName.mp4',
|
||||
'https://media1.tenor.com/m/gifId',
|
||||
|
||||
'https://tenor.com/view/gifId',
|
||||
'https://tenor.com/notView/gifId',
|
||||
'https://tenor.com/view',
|
||||
'https://tenor.com/view/gifId.gif',
|
||||
|
||||
'https://c.tenor.com/gifId/tenor.gif',
|
||||
'https://c.tenor.com/gifId/tenor.webp',
|
||||
'https://c.tenor.com/gifId/tenor.mp4',
|
||||
]
|
||||
|
||||
const outputs = [
|
||||
@@ -544,6 +577,90 @@ describe('parseEmbedPlayerFromUrl', () => {
|
||||
videoId: 'videoId',
|
||||
playerUri: 'https://player.vimeo.com/video/videoId?autoplay=1',
|
||||
},
|
||||
|
||||
{
|
||||
type: 'giphy_gif',
|
||||
imageUri: 'https://i.giphy.com/media/gifId/giphy.gif',
|
||||
},
|
||||
undefined,
|
||||
undefined,
|
||||
|
||||
{
|
||||
type: 'giphy_gif',
|
||||
imageUri: 'https://i.giphy.com/media/gifId/giphy.gif',
|
||||
},
|
||||
{
|
||||
type: 'giphy_gif',
|
||||
imageUri: 'https://i.giphy.com/media/gifId/giphy.gif',
|
||||
},
|
||||
{
|
||||
type: 'giphy_gif',
|
||||
imageUri: 'https://i.giphy.com/media/gifId/giphy.gif',
|
||||
},
|
||||
{
|
||||
type: 'giphy_gif',
|
||||
imageUri: 'https://i.giphy.com/media/gifId/giphy.gif',
|
||||
},
|
||||
{
|
||||
type: 'giphy_gif',
|
||||
imageUri: 'https://i.giphy.com/media/gifId/giphy.gif',
|
||||
},
|
||||
{
|
||||
type: 'giphy_gif',
|
||||
imageUri: 'https://i.giphy.com/media/gifId/giphy.gif',
|
||||
},
|
||||
undefined,
|
||||
undefined,
|
||||
|
||||
{
|
||||
type: 'giphy_gif',
|
||||
imageUri: 'https://i.giphy.com/media/gifId/giphy.gif',
|
||||
},
|
||||
|
||||
{
|
||||
type: 'giphy_gif',
|
||||
imageUri: 'https://i.giphy.com/media/gifId/giphy.gif',
|
||||
},
|
||||
{
|
||||
type: 'giphy_gif',
|
||||
imageUri: 'https://i.giphy.com/media/gifId/giphy.gif',
|
||||
},
|
||||
{
|
||||
type: 'giphy_gif',
|
||||
imageUri: 'https://i.giphy.com/media/gifId/giphy.gif',
|
||||
},
|
||||
{
|
||||
type: 'giphy_gif',
|
||||
imageUri: 'https://i.giphy.com/media/gifId/giphy.gif',
|
||||
},
|
||||
|
||||
{
|
||||
type: 'tenor_gif',
|
||||
imageUri: 'https://media1.tenor.com/m/gifId/someName.gif',
|
||||
},
|
||||
undefined,
|
||||
undefined,
|
||||
|
||||
{
|
||||
type: 'tenor_gif',
|
||||
imageUri: 'https://tenor.com/view/gifId.gif',
|
||||
},
|
||||
undefined,
|
||||
undefined,
|
||||
{
|
||||
type: 'tenor_gif',
|
||||
imageUri: 'https://tenor.com/view/gifId.gif',
|
||||
},
|
||||
|
||||
{
|
||||
type: 'tenor_gif',
|
||||
imageUri: 'https://c.tenor.com/gifId/tenor.gif',
|
||||
},
|
||||
{
|
||||
type: 'tenor_gif',
|
||||
imageUri: 'https://c.tenor.com/gifId/tenor.webp',
|
||||
},
|
||||
undefined,
|
||||
]
|
||||
|
||||
it('correctly grabs the correct id from uri', () => {
|
||||
|
||||
Reference in New Issue
Block a user