From 027034c8323c957f222d84cbf00603469cdf4a72 Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Fri, 27 Sep 2024 19:59:07 -0400 Subject: [PATCH] HTML web component test cae --- .../html-web-component.spec.js | 58 +++++++++++++++++++ .../src/components/picture-frame.js | 14 +++++ .../html-web-component/src/pages/index.js | 23 ++++++++ test/cases/light-dom/light-dom.spec.js | 1 - 4 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 test/cases/html-web-component/html-web-component.spec.js create mode 100644 test/cases/html-web-component/src/components/picture-frame.js create mode 100644 test/cases/html-web-component/src/pages/index.js diff --git a/test/cases/html-web-component/html-web-component.spec.js b/test/cases/html-web-component/html-web-component.spec.js new file mode 100644 index 0000000..cdf2ed4 --- /dev/null +++ b/test/cases/html-web-component/html-web-component.spec.js @@ -0,0 +1,58 @@ +/* + * Use Case + * Run wcc against an "HTML" Web Component. + * https://blog.jim-nielsen.com/2023/html-web-components/ + * + * User Result + * Should return the expected HTML with no template tags or Shadow Roots. + * + * User Workspace + * src/ + * components/ + * picture-frame.js + * pages/ + * index.js + */ +import chai from 'chai'; +import { JSDOM } from 'jsdom'; +import { renderToString } from '../../../src/wcc.js'; + +const expect = chai.expect; + +describe('Run WCC For ', function() { + const LABEL = 'HTML Web Component'; + let dom; + let pictureFrame; + + before(async function() { + const { html } = await renderToString(new URL('./src/pages/index.js', import.meta.url)); + + dom = new JSDOM(html); + pictureFrame = dom.window.document.querySelectorAll('wcc-picture-frame'); + }); + + describe(LABEL, function() { + it('should not have any