(getApp: (state: any) => ComponentOptions)
| 16 | |
| 17 | describe('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 => ({ |
no test coverage detected