Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
test(ui/style-provider): update snap
Browse files Browse the repository at this point in the history
  • Loading branch information
ayangweb committed Mar 16, 2022
1 parent af74fc5 commit 0025916
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions packages/varlet-vue2-ui/src/style-provider/__tests__/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ test('test styleProvider plugin', () => {
expect(Vue.component(VarStyleProvider.name)).toBeTruthy()
})

// test('test styleProvider functional', async () => {
// StyleProvider({
// 'cell-font-size': '30px',
// })
test('test styleProvider functional', async () => {
StyleProvider({
'cell-font-size': '30px',
})

// await delay(0)
// expect(getComputedStyle(document.documentElement).getPropertyValue('--cell-font-size')).toBe('30px')
// })
await delay(0)
expect(getComputedStyle(document.documentElement).getPropertyValue('--cell-font-size')).toBe('30px')
})

// test('test styleProvider component', async () => {
// const wrapper = mount(VarStyleProvider)
test('test styleProvider component', async () => {
const wrapper = mount(VarStyleProvider)

// const el = wrapper.find('.var-style-provider')
// expect(el.exists()).toBe(true)
const el = wrapper.find('.var-style-provider')
expect(el.exists()).toBe(true)

// await wrapper.setProps({
// styleVars: {
// 'cell-font-size': '30px',
// },
// })
// expect(el.attributes('style')).toBe('--cell-font-size: 30px;')
// })
await wrapper.setProps({
styleVars: {
'cell-font-size': '30px',
},
})
expect(el.attributes('style')).toBe('--cell-font-size: 30px;')
})

0 comments on commit 0025916

Please sign in to comment.