Skip to content

Commit fb27ae3

Browse files
authored
test: add test case for Q22 (webfansplz#551)
1 parent 846802e commit fb27ae3

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

questions/22-custom-element/README.md

+1-1
Large diffs are not rendered by default.

questions/22-custom-element/README.zh-CN.md

+1-1
Large diffs are not rendered by default.
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { mount } from "@vue/test-utils"
2+
import { describe, it, expect } from "vitest"
3+
4+
import App from "./App.vue"
5+
6+
describe("custom-component", () => {
7+
it("should work", () => {
8+
const wrapper = mount(App, { attachTo: document.body })
9+
const custom = wrapper.find('vue-js')
10+
expect(custom.exists()).toBeTruthy()
11+
expect(custom.element.shadowRoot?.innerHTML).toBe("<span>Hello Vue.js</span>")
12+
})
13+
})

0 commit comments

Comments
 (0)