Home / File/ useCssVars.spec.ts — vue Source File

useCssVars.spec.ts — vue Source File

Architecture documentation for useCssVars.spec.ts, a typescript file in the vue codebase. 2 imports, 0 dependents.

File typescript 2 imports

Entity Profile

Dependency Diagram

graph LR
  238de45c_16bd_3ef5_23d5_7d05209d1577["useCssVars.spec.ts"]
  db9e7bef_009d_3918_6e7d_543a36a38d75["vue"]
  238de45c_16bd_3ef5_23d5_7d05209d1577 --> db9e7bef_009d_3918_6e7d_543a36a38d75
  d970b406_3424_b00e_55dd_82e98ab5aac2["v3"]
  238de45c_16bd_3ef5_23d5_7d05209d1577 --> d970b406_3424_b00e_55dd_82e98ab5aac2
  style 238de45c_16bd_3ef5_23d5_7d05209d1577 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import Vue from 'vue'
import { useCssVars, h, reactive, nextTick } from 'v3'

describe('useCssVars', () => {
  async function assertCssVars(getApp: (state: any) => any) {
    const state = reactive({ color: 'red' })
    const App = getApp(state)
    const vm = new Vue(App).$mount()
    await nextTick()
    expect((vm.$el as HTMLElement).style.getPropertyValue(`--color`)).toBe(
      `red`
    )

    state.color = 'green'
    await nextTick()
    expect((vm.$el as HTMLElement).style.getPropertyValue(`--color`)).toBe(
      `green`
    )
  }

  test('basic', async () => {
    await assertCssVars(state => ({
      setup() {
        // test receiving render context
        useCssVars(vm => ({
          color: vm.color
        }))
        return state
      },
      render() {
        return h('div')
      }
    }))
  })

  test('on HOCs', async () => {
    const Child = {
      render: () => h('div')
    }

    await assertCssVars(state => ({
      setup() {
        useCssVars(() => state)
        return () => h(Child)
      }
    }))
  })
})

Dependencies

  • v3
  • vue

Frequently Asked Questions

What does useCssVars.spec.ts do?
useCssVars.spec.ts is a source file in the vue codebase, written in typescript.
What does useCssVars.spec.ts depend on?
useCssVars.spec.ts imports 2 module(s): v3, vue.
Where is useCssVars.spec.ts in the architecture?
useCssVars.spec.ts is located at test/unit/features/v3/useCssVars.spec.ts (directory: test/unit/features/v3).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free