wcb/test/e2e/just-parts.test.mjs
Ayo ce30b114a2 chore: new demo workspace & e2e tests
- this adds a new demo web app with vite HMR for development
- all examples are covered with e2e tests
2026-07-05 15:40:53 +02:00

19 lines
539 B
JavaScript

import { beforeEach, expect, test } from 'vitest'
import '../../demo/examples/just-parts/index.js'
beforeEach(() => {
document.body.innerHTML = ''
})
test('html + createElement build interactive DOM on a vanilla HTMLElement', () => {
document.body.innerHTML = '<my-quote></my-quote>'
const btn = document.querySelector('#quote-btn')
expect(btn).toBeTruthy()
expect(btn.textContent.trim()).toBe('click me')
btn.click()
expect(btn.textContent).toBe('clicked 1')
btn.click()
expect(btn.textContent).toBe('clicked 2')
})