diff options
author | Aryan Goharzad <arrygoo@gmail.com> | 2023-01-19 13:53:11 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-19 12:53:11 -0600 |
commit | f10a8308d9f6bfb907c8a2458cbf78b4cfad88d2 (patch) | |
tree | 0cb50ba6736ea67773e76f9000d07095a654bb6d /__tests__/lib/string.test.ts | |
parent | 9230d52ff596056429a773298b2728619afe3432 (diff) | |
download | voidsky-f10a8308d9f6bfb907c8a2458cbf78b4cfad88d2.tar.zst |
Fixes youtube embed issues (#50)
* fixes youtube embed * move extractMetaHtml test to its own file * tests cleanup * Add fallback for youtube meta data * lint * Check for youtube in the url domain * use hostname instead of full url to check for link domain * checks only for domain
Diffstat (limited to '__tests__/lib/string.test.ts')
-rw-r--r-- | __tests__/lib/string.test.ts | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/__tests__/lib/string.test.ts b/__tests__/lib/string.test.ts index d8a56b36b..0032ebf31 100644 --- a/__tests__/lib/string.test.ts +++ b/__tests__/lib/string.test.ts @@ -1,7 +1,6 @@ import { extractEntities, detectLinkables, - extractHtmlMeta, pluralize, makeRecordUri, ago, @@ -286,48 +285,6 @@ describe('detectLinkables', () => { }) }) -describe('extractHtmlMeta', () => { - const inputs = [ - '', - 'nothing', - '<title>title</title>', - '<title> aSd!@#AC </title>', - '<title>\n title\n </title>', - '<meta name="title" content="meta title">', - '<meta name="description" content="meta description">', - '<meta property="og:title" content="og title">', - '<meta property="og:description" content="og description">', - '<meta property="og:image" content="https://ogimage.com/foo.png">', - '<meta property="twitter:title" content="twitter title">', - '<meta property="twitter:description" content="twitter description">', - '<meta property="twitter:image" content="https://twitterimage.com/foo.png">', - '<meta\n name="title"\n content="meta title"\n>', - ] - const outputs = [ - {}, - {}, - {title: 'title'}, - {title: 'aSd!@#AC'}, - {title: 'title'}, - {title: 'meta title'}, - {description: 'meta description'}, - {title: 'og title'}, - {description: 'og description'}, - {image: 'https://ogimage.com/foo.png'}, - {title: 'twitter title'}, - {description: 'twitter description'}, - {image: 'https://twitterimage.com/foo.png'}, - {title: 'meta title'}, - ] - it('correctly handles a set of text inputs', () => { - for (let i = 0; i < inputs.length; i++) { - const input = inputs[i] - const output = extractHtmlMeta(input) - expect(output).toEqual(outputs[i]) - } - }) -}) - describe('pluralize', () => { const inputs: [number, string, string?][] = [ [1, 'follower'], |