1f71a3a3fe
* Add shared event presentation context * Add app-web event presentation mapper * Wire event presentation provider into app timelines * Add Storybook controls for event layout and density * Wire compact density through app/web event presentation provider * Use event presentation density for URL previews * Move TileErrorView layout to event presentation context * Minor fix and updated snapshot * Updated snapshots for url preview group * Prettier fix * Restore removed story to fix missing playwright test * Updates after review comments * Fix prettier issue
219 lines
5.7 KiB
Plaintext
219 lines
5.7 KiB
Plaintext
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
|
|
exports[`UrlPreviewGroupViewModel handles different kinds of opengraph responses {\\n 'og:url': 'https://example.org',\\n 'og:type': 'document',\\n 'og:description': 'A description',\\n 'og:title': ''\\n} 1`] = `
|
|
{
|
|
"author": undefined,
|
|
"description": undefined,
|
|
"image": undefined,
|
|
"link": "https://example.org",
|
|
"showTooltipOnLink": false,
|
|
"siteIcon": undefined,
|
|
"siteName": "example.org",
|
|
"title": "A description",
|
|
}
|
|
`;
|
|
|
|
exports[`UrlPreviewGroupViewModel handles different kinds of opengraph responses {\\n 'og:url': 'https://example.org',\\n 'og:type': 'document',\\n 'og:site_name': 'Site name',\\n 'og:title': ''\\n} 1`] = `
|
|
{
|
|
"author": undefined,
|
|
"description": undefined,
|
|
"image": undefined,
|
|
"link": "https://example.org",
|
|
"showTooltipOnLink": false,
|
|
"siteIcon": undefined,
|
|
"siteName": "Site name",
|
|
"title": "Site name",
|
|
}
|
|
`;
|
|
|
|
exports[`UrlPreviewGroupViewModel handles different kinds of opengraph responses {\\n 'og:url': 'https://example.org',\\n 'og:type': 'document',\\n 'og:title': 'Basic title'\\n} 1`] = `
|
|
{
|
|
"author": undefined,
|
|
"description": undefined,
|
|
"image": undefined,
|
|
"link": "https://example.org",
|
|
"showTooltipOnLink": false,
|
|
"siteIcon": undefined,
|
|
"siteName": "example.org",
|
|
"title": "Basic title",
|
|
}
|
|
`;
|
|
|
|
exports[`UrlPreviewGroupViewModel handles different kinds of opengraph responses {\\n 'og:url': 'https://example.org',\\n 'og:type': 'document',\\n 'og:title': 'Cool blog',\\n 'og:site_name': 'Cool site'\\n} 1`] = `
|
|
{
|
|
"author": undefined,
|
|
"description": undefined,
|
|
"image": undefined,
|
|
"link": "https://example.org",
|
|
"showTooltipOnLink": false,
|
|
"siteIcon": undefined,
|
|
"siteName": "Cool site",
|
|
"title": "Cool blog",
|
|
}
|
|
`;
|
|
|
|
exports[`UrlPreviewGroupViewModel handles different kinds of opengraph responses {\\n 'og:url': 'https://example.org',\\n 'og:type': 'document',\\n 'og:title': 'Media test',\\n 'og:image:height': '500',\\n 'og:image:width': 500,\\n 'matrix:image:size': 10000,\\n 'og:image': 'mxc://example.org/abc'\\n} 1`] = `
|
|
{
|
|
"author": undefined,
|
|
"description": undefined,
|
|
"image": {
|
|
"alt": undefined,
|
|
"fileSize": 10000,
|
|
"height": 478,
|
|
"imageFull": "https://example.org/image/src",
|
|
"imageThumb": "https://example.org/image/thumb",
|
|
"playable": false,
|
|
"width": 478,
|
|
},
|
|
"link": "https://example.org",
|
|
"showTooltipOnLink": false,
|
|
"siteIcon": undefined,
|
|
"siteName": "example.org",
|
|
"title": "Media test",
|
|
}
|
|
`;
|
|
|
|
exports[`UrlPreviewGroupViewModel should deduplicate multiple versions of the same URL 1`] = `
|
|
{
|
|
"overPreviewLimit": false,
|
|
"previews": [
|
|
{
|
|
"author": undefined,
|
|
"description": "This is a description",
|
|
"image": undefined,
|
|
"link": "https://example.org",
|
|
"showTooltipOnLink": false,
|
|
"siteIcon": undefined,
|
|
"siteName": "Example.org",
|
|
"title": "This is an example!",
|
|
},
|
|
],
|
|
"previewsLimited": true,
|
|
"totalPreviewCount": 1,
|
|
}
|
|
`;
|
|
|
|
exports[`UrlPreviewGroupViewModel should handle being hidden and shown by the user 1`] = `
|
|
{
|
|
"overPreviewLimit": false,
|
|
"previews": [],
|
|
"previewsLimited": true,
|
|
"totalPreviewCount": 1,
|
|
}
|
|
`;
|
|
|
|
exports[`UrlPreviewGroupViewModel should handle being hidden and shown by the user 2`] = `
|
|
{
|
|
"overPreviewLimit": false,
|
|
"previews": [
|
|
{
|
|
"author": undefined,
|
|
"description": "This is a description",
|
|
"image": undefined,
|
|
"link": "https://example.org",
|
|
"showTooltipOnLink": false,
|
|
"siteIcon": undefined,
|
|
"siteName": "Example.org",
|
|
"title": "This is an example!",
|
|
},
|
|
],
|
|
"previewsLimited": true,
|
|
"totalPreviewCount": 1,
|
|
}
|
|
`;
|
|
|
|
exports[`UrlPreviewGroupViewModel should hide preview when invisible 1`] = `
|
|
{
|
|
"overPreviewLimit": false,
|
|
"previews": [],
|
|
"previewsLimited": true,
|
|
"totalPreviewCount": 1,
|
|
}
|
|
`;
|
|
|
|
exports[`UrlPreviewGroupViewModel should ignore failed previews 1`] = `
|
|
{
|
|
"overPreviewLimit": false,
|
|
"previews": [],
|
|
"previewsLimited": true,
|
|
"totalPreviewCount": 1,
|
|
}
|
|
`;
|
|
|
|
exports[`UrlPreviewGroupViewModel should ignore media when mediaVisible is false 1`] = `
|
|
{
|
|
"overPreviewLimit": false,
|
|
"previews": [
|
|
{
|
|
"author": undefined,
|
|
"description": undefined,
|
|
"image": undefined,
|
|
"link": "https://example.org",
|
|
"showTooltipOnLink": false,
|
|
"siteIcon": undefined,
|
|
"siteName": "example.org",
|
|
"title": "This is an example!",
|
|
},
|
|
],
|
|
"previewsLimited": true,
|
|
"totalPreviewCount": 1,
|
|
}
|
|
`;
|
|
|
|
exports[`UrlPreviewGroupViewModel should preview a URL with media 1`] = `
|
|
{
|
|
"overPreviewLimit": false,
|
|
"previews": [
|
|
{
|
|
"author": undefined,
|
|
"description": undefined,
|
|
"image": {
|
|
"alt": undefined,
|
|
"fileSize": 10000,
|
|
"height": 128,
|
|
"imageFull": "https://example.org/image/src",
|
|
"imageThumb": "https://example.org/image/thumb",
|
|
"playable": false,
|
|
"width": 128,
|
|
},
|
|
"link": "https://example.org",
|
|
"showTooltipOnLink": false,
|
|
"siteIcon": undefined,
|
|
"siteName": "example.org",
|
|
"title": "This is an example!",
|
|
},
|
|
],
|
|
"previewsLimited": true,
|
|
"totalPreviewCount": 1,
|
|
}
|
|
`;
|
|
|
|
exports[`UrlPreviewGroupViewModel should preview a single valid URL 1`] = `
|
|
{
|
|
"overPreviewLimit": false,
|
|
"previews": [
|
|
{
|
|
"author": undefined,
|
|
"description": "This is a description",
|
|
"image": undefined,
|
|
"link": "https://example.org",
|
|
"showTooltipOnLink": false,
|
|
"siteIcon": undefined,
|
|
"siteName": "Example.org",
|
|
"title": "This is an example!",
|
|
},
|
|
],
|
|
"previewsLimited": true,
|
|
"totalPreviewCount": 1,
|
|
}
|
|
`;
|
|
|
|
exports[`UrlPreviewGroupViewModel should return no previews by default 1`] = `
|
|
{
|
|
"overPreviewLimit": false,
|
|
"previews": [],
|
|
"previewsLimited": true,
|
|
"totalPreviewCount": 0,
|
|
}
|
|
`;
|