MCPcopy
hub / github.com/vuejs/core / assertCssVars

Function assertCssVars

packages/runtime-dom/__tests__/helpers/useCssVars.spec.ts:18–34  ·  view source on GitHub ↗
(getApp: (state: any) => ComponentOptions)

Source from the content-addressed store, hash-verified

16
17describe('useCssVars', () => {
18 async function assertCssVars(getApp: (state: any) => ComponentOptions) {
19 const state = reactive({ color: 'red' })
20 const App = getApp(state)
21 const root = document.createElement('div')
22
23 render(h(App), root)
24 await nextTick()
25 for (const c of [].slice.call(root.children as any)) {
26 expect((c as HTMLElement).style.getPropertyValue(`--color`)).toBe(`red`)
27 }
28
29 state.color = 'green'
30 await nextTick()
31 for (const c of [].slice.call(root.children as any)) {
32 expect((c as HTMLElement).style.getPropertyValue(`--color`)).toBe('green')
33 }
34 }
35
36 test('basic', async () => {
37 await assertCssVars(state => ({

Callers 1

useCssVars.spec.tsFile · 0.85

Calls 5

renderFunction · 0.90
reactiveFunction · 0.85
hFunction · 0.85
createElementMethod · 0.80
nextTickFunction · 0.50

Tested by

no test coverage detected