9df7182c0c
* Commit design update * Add figma links * Check in other changes * revert accidental change * Iterative update * linting n test fiddles * linting * Cleanup * update snaps * Move URL previews to new home * Fix paths * compress img * Add back all the stories * Improved rendering * Fixup * Update previews again * lint * update stories * Update snaps again * More screenshots * Also these * Update snaps * include site name * Update snaps again * Use a scale so the images don't go blur * update snaps again * Update snaps * remove mistaken playwright cfg * update pw snaps * update snap * update previews * Update with new designs * Update screenshots
228 lines
6.0 KiB
Plaintext
228 lines
6.0 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`] = `
|
|
{
|
|
"compactLayout": false,
|
|
"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`] = `
|
|
{
|
|
"compactLayout": false,
|
|
"overPreviewLimit": false,
|
|
"previews": [],
|
|
"previewsLimited": true,
|
|
"totalPreviewCount": 1,
|
|
}
|
|
`;
|
|
|
|
exports[`UrlPreviewGroupViewModel should handle being hidden and shown by the user 2`] = `
|
|
{
|
|
"compactLayout": false,
|
|
"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`] = `
|
|
{
|
|
"compactLayout": false,
|
|
"overPreviewLimit": false,
|
|
"previews": [],
|
|
"previewsLimited": true,
|
|
"totalPreviewCount": 1,
|
|
}
|
|
`;
|
|
|
|
exports[`UrlPreviewGroupViewModel should ignore failed previews 1`] = `
|
|
{
|
|
"compactLayout": false,
|
|
"overPreviewLimit": false,
|
|
"previews": [],
|
|
"previewsLimited": true,
|
|
"totalPreviewCount": 1,
|
|
}
|
|
`;
|
|
|
|
exports[`UrlPreviewGroupViewModel should ignore media when mediaVisible is false 1`] = `
|
|
{
|
|
"compactLayout": false,
|
|
"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`] = `
|
|
{
|
|
"compactLayout": false,
|
|
"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`] = `
|
|
{
|
|
"compactLayout": false,
|
|
"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`] = `
|
|
{
|
|
"compactLayout": false,
|
|
"overPreviewLimit": false,
|
|
"previews": [],
|
|
"previewsLimited": true,
|
|
"totalPreviewCount": 0,
|
|
}
|
|
`;
|