diff options
Diffstat (limited to 'packages/integrations/vue/test/app-entrypoint.test.js')
-rw-r--r-- | packages/integrations/vue/test/app-entrypoint.test.js | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/packages/integrations/vue/test/app-entrypoint.test.js b/packages/integrations/vue/test/app-entrypoint.test.js index 4f4f389d1..b20e7be7e 100644 --- a/packages/integrations/vue/test/app-entrypoint.test.js +++ b/packages/integrations/vue/test/app-entrypoint.test.js @@ -1,6 +1,8 @@ import { loadFixture } from './test-utils.js'; import { expect } from 'chai'; +import { load as cheerioLoad } from 'cheerio'; import { parseHTML } from 'linkedom'; + describe('App Entrypoint', () => { /** @type {import('./test-utils').Fixture} */ let fixture; @@ -13,11 +15,21 @@ describe('App Entrypoint', () => { }); it('loads during SSR', async () => { - const data = await fixture.readFile('/index.html'); - const { document } = parseHTML(data); - const bar = document.querySelector('#foo > #bar'); - expect(bar).not.to.be.undefined; - expect(bar.textContent).to.eq('works'); + const html = await fixture.readFile('/index.html'); + const $ = cheerioLoad(html); + + // test 1: basic component renders + expect($('#foo > #bar').text()).to.eq('works'); + + // test 2: component with multiple script blocks renders and exports + // values from non setup block correctly + expect($('#multiple-script-blocks').text()).to.equal('2 4'); + + // test 3: component using generics renders + expect($('#generics').text()).to.equal('generic'); + + // test 4: component using generics and multiple script blocks renders + expect($('#generics-and-blocks').text()).to.equal('1 3!!!'); }); it('setup included in renderer bundle', async () => { |