From 00ca54b1aef4e64d712825ae280327cb37636e57 Mon Sep 17 00:00:00 2001 From: Kiko Beats Date: Sun, 19 May 2024 17:38:33 +0200 Subject: [PATCH] test: update genially fixture --- .../test/fixtures/genially.html | 425 +++++++++++++++--- packages/metascraper-iframe/test/index.js | 9 +- packages/metascraper-iframe/test/test.js | 2 +- 3 files changed, 357 insertions(+), 79 deletions(-) diff --git a/packages/metascraper-iframe/test/fixtures/genially.html b/packages/metascraper-iframe/test/fixtures/genially.html index bd9de7931..a4302c923 100644 --- a/packages/metascraper-iframe/test/fixtures/genially.html +++ b/packages/metascraper-iframe/test/fixtures/genially.html @@ -1,74 +1,353 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Magic - 15 - - - - - - - -
-
-
- - - - +Magic - 15 - CHEMA

Full screen

Share

Show pages

Plays background audio

Activate the genially's audio here

Chema Roldán 
15 minutos geniales
+ +
+ +

Oops, wrong

Don't give up!

Next page

genially options

diff --git a/packages/metascraper-iframe/test/index.js b/packages/metascraper-iframe/test/index.js index 2ea44aa77..89d1c57dc 100644 --- a/packages/metascraper-iframe/test/index.js +++ b/packages/metascraper-iframe/test/index.js @@ -13,10 +13,9 @@ const createMetascraper = (...args) => require('metascraper')([createMetascraperIframe(...args)]) test('provide `gotOpts`', async t => { - console.log('running') const dnsCache = new CacheableLookup() const html = await readFile(resolve(__dirname, 'fixtures/genially.html')) - const url = 'https://view.genial.ly/5dc53cfa759d2a0f4c7db5f4' + const url = 'https://view.genially.com/5dc53cfa759d2a0f4c7db5f4' const metascraper = createMetascraper({ gotOpts: { dnsCache } }) const metadataOne = await metascraper({ @@ -26,7 +25,7 @@ test('provide `gotOpts`', async t => { }) t.truthy(metadataOne.iframe) - t.is(dnsCache._cache.size, 2) + t.is(dnsCache._cache.size, 1) const metadataTwo = await metascraper({ url, @@ -35,7 +34,7 @@ test('provide `gotOpts`', async t => { }) t.truthy(metadataTwo.iframe) - t.is(dnsCache._cache.size, 2) + t.is(dnsCache._cache.size, 1) }) test('provide `iframe`', async t => { @@ -55,7 +54,7 @@ commonProviders.forEach(url => { test('get iframe from markup', async t => { const html = await readFile(resolve(__dirname, 'fixtures/genially.html')) - const url = 'https://view.genial.ly/5dc53cfa759d2a0f4c7db5f4' + const url = 'https://view.genially.com/5dc53cfa759d2a0f4c7db5f4' const rules = [createMetascraperIframe()] const metascraper = createMetascraper(rules) const metadata = await metascraper({ url, html }) diff --git a/packages/metascraper-iframe/test/test.js b/packages/metascraper-iframe/test/test.js index a485c46ec..2c6a80d70 100644 --- a/packages/metascraper-iframe/test/test.js +++ b/packages/metascraper-iframe/test/test.js @@ -24,7 +24,7 @@ test('false', t => { test('from markup', async t => { const html = await readFile(resolve(__dirname, 'fixtures/genially.html')) - const url = 'https://view.genial.ly/5dc53cfa759d2a0f4c7db5f4' + const url = 'https://view.genially.com/5dc53cfa759d2a0f4c7db5f4' const htmlDom = cheerio.load(html) t.true(validator(url, htmlDom)) })