From 16cefdf9deb8ba484de58e05f88b1311445989d4 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Tue, 31 May 2022 10:49:11 -0500 Subject: [PATCH] test: add failing test for empty slots --- packages/astro/test/astro-slots.test.js | 10 ++++++++++ .../test/fixtures/astro-slots/src/pages/empty.astro | 13 +++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 packages/astro/test/fixtures/astro-slots/src/pages/empty.astro diff --git a/packages/astro/test/astro-slots.test.js b/packages/astro/test/astro-slots.test.js index 60d4e25603..b21636a4d7 100644 --- a/packages/astro/test/astro-slots.test.js +++ b/packages/astro/test/astro-slots.test.js @@ -44,6 +44,16 @@ describe('Slots', () => { expect($('#override')).to.have.lengthOf(1); }); + it('Components that accept slots don\'t require theme', async () => { + const html = await fixture.readFile('/empty.html'); + const $ = cheerio.load(html); + + expect($('#a').length).to.equal(1); + expect($('#b').length).to.equal(1); + expect($('#c').length).to.equal(1); + expect($('#default').length).to.equal(1); + }); + it('Slots work with multiple elements', async () => { const html = await fixture.readFile('/multiple/index.html'); const $ = cheerio.load(html); diff --git a/packages/astro/test/fixtures/astro-slots/src/pages/empty.astro b/packages/astro/test/fixtures/astro-slots/src/pages/empty.astro new file mode 100644 index 0000000000..54f609d18e --- /dev/null +++ b/packages/astro/test/fixtures/astro-slots/src/pages/empty.astro @@ -0,0 +1,13 @@ +--- +import Slotted from '../components/Slotted.astro'; +--- + + + + + + + + + +