diff --git a/packages/astro/test/astro-client-only.test.js b/packages/astro/test/astro-client-only.test.js index 6dfcb8d0a..28a34ba8a 100644 --- a/packages/astro/test/astro-client-only.test.js +++ b/packages/astro/test/astro-client-only.test.js @@ -1,5 +1,5 @@ /** - * UNCOMMENT: when "window is not defined" error fixed in Vite + * UNCOMMENT: fix "Error: Unable to render PersistentCounter because it is null!" import { expect } from 'chai'; import cheerio from 'cheerio'; import { loadFixture } from './test-utils.js'; @@ -11,7 +11,6 @@ before(async () => { await fixture.build(); }); -// TODO: fix "window is not defined" error in Vite describe('Client only components', () => { it('Loads pages using client:only hydrator', async () => { const html = await fixture.readFile('/index.html'); diff --git a/packages/astro/test/astro-styles-ssr.test.js b/packages/astro/test/astro-styles-ssr.test.js index ca7474831..31f643d17 100644 --- a/packages/astro/test/astro-styles-ssr.test.js +++ b/packages/astro/test/astro-styles-ssr.test.js @@ -87,8 +87,7 @@ describe('Styles SSR', () => { expect(wrapper).to.have.lengthOf(1); }); - // TODO: add dynamic class scoping in compiler - it.skip('Astro scoped styles', async () => { + it('Astro scoped styles', async () => { const html = await fixture.readFile('/index.html'); const $ = cheerio.load(html); @@ -111,10 +110,13 @@ describe('Styles SSR', () => { expect(el1.attr('class')).to.equal(`blue ${scopedClass}`); expect(el2.attr('class')).to.equal(`visible ${scopedClass}`); - const css = $('style').text(); + let css = ''; + $('style').each((_, el) => { + css += $(el).html(); + }); // test 4: CSS generates as expected - expect(css.toString()).to.equal(`.blue.${scopedClass}{color:powderblue}.color\\:blue.${scopedClass}{color:powderblue}.visible.${scopedClass}{display:block}`); + expect(css).to.include(`.blue.${scopedClass}{color:powderblue;}.color\\:blue.${scopedClass}{color:powderblue;}.visible.${scopedClass}{display:block;}`); }); it('Astro scoped styles skipped without