Skip to content

Commit

Permalink
build: sync and lock vue version
Browse files Browse the repository at this point in the history
  • Loading branch information
qmhc committed Apr 24, 2024
1 parent 41f9fb5 commit 8b4c2bb
Show file tree
Hide file tree
Showing 9 changed files with 202 additions and 59 deletions.
3 changes: 0 additions & 3 deletions common/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
"@vexip-ui/utils": "workspace:*",
"lucide-vue-next": "^0.365.0"
},
"devDependencies": {
"vue": "^3.4.21"
},
"peerDependencies": {
"vue": "^3.2.25"
}
Expand Down
3 changes: 0 additions & 3 deletions common/hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@
"@juggle/resize-observer": "^3.4.0",
"@vexip-ui/utils": "workspace:*"
},
"devDependencies": {
"vue": "^3.4.21"
},
"peerDependencies": {
"vue": "^3.2.25"
}
Expand Down
3 changes: 1 addition & 2 deletions common/icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
"fast-glob": "^3.3.2",
"fs-extra": "^11.2.0",
"kolorist": "^1.8.0",
"prettier": "^3.2.5",
"vue": "^3.4.21"
"prettier": "^3.2.5"
},
"peerDependencies": {
"vue": "^3.2.25"
Expand Down
15 changes: 8 additions & 7 deletions components/switch/tests/switch.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { describe, expect, it, vi } from 'vitest'
import { nextTick } from 'vue'
import { mount } from '@vue/test-utils'

import { Github, Loader2, User } from 'lucide-vue-next'
import { Hammer, User } from 'lucide-vue-next'
import { globalIcons } from '@vexip-ui/config'
import { Switch } from '..'

describe('Switch', () => {
Expand Down Expand Up @@ -97,11 +98,11 @@ describe('Switch', () => {
const wrapper = mount(Switch)

expect(wrapper.classes()).not.toContain('vxp-switch--loading')
expect(wrapper.findComponent(Loader2).exists()).toBe(false)
expect(wrapper.findComponent(globalIcons.value.loading.icon).exists()).toBe(false)

await wrapper.setProps({ loading: true })
expect(wrapper.classes()).toContain('vxp-switch--loading')
expect(wrapper.findComponent(Loader2).exists()).toBe(true)
expect(wrapper.findComponent(globalIcons.value.loading.icon).exists()).toBe(true)
})

it('inner text', async () => {
Expand All @@ -126,21 +127,21 @@ describe('Switch', () => {
it('icon', async () => {
const wrapper = mount(Switch, {
props: {
openIcon: Github,
openIcon: Hammer,
closeIcon: User
}
})

expect(wrapper.findComponent(User).exists()).toBe(true)
expect(wrapper.findComponent(Github).exists()).toBe(false)
expect(wrapper.findComponent(Hammer).exists()).toBe(false)

await wrapper.setProps({ value: true })
expect(wrapper.findComponent(User).exists()).toBe(false)
expect(wrapper.findComponent(Github).exists()).toBe(true)
expect(wrapper.findComponent(Hammer).exists()).toBe(true)

await wrapper.setProps({ loading: true })
expect(wrapper.findComponent(User).exists()).toBe(false)
expect(wrapper.findComponent(Github).exists()).toBe(false)
expect(wrapper.findComponent(Hammer).exists()).toBe(false)
})

it('before change', async () => {
Expand Down
6 changes: 3 additions & 3 deletions components/textarea/tests/textarea.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { describe, expect, it, vi } from 'vitest'
import { nextTick } from 'vue'
import { mount } from '@vue/test-utils'

import { Loader2 } from 'lucide-vue-next'
import { globalIcons } from '@vexip-ui/config'
import { Textarea } from '..'

import type { DOMWrapper } from '@vue/test-utils'
Expand Down Expand Up @@ -69,11 +69,11 @@ describe('Textarea', () => {
const wrapper = mount(Textarea)

expect(wrapper.find('.vxp-textarea__loading').exists()).toBe(false)
expect(wrapper.findComponent(Loader2).exists()).toBe(false)
expect(wrapper.findComponent(globalIcons.value.loading.icon).exists()).toBe(false)

await wrapper.setProps({ loading: true })
expect(wrapper.find('.vxp-textarea__loading').exists()).toBe(true)
expect(wrapper.findComponent(Loader2).exists()).toBe(true)
expect(wrapper.findComponent(globalIcons.value.loading.icon).exists()).toBe(true)
})

it('loading lock', async () => {
Expand Down
21 changes: 11 additions & 10 deletions components/transfer/tests/transfer.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { describe, expect, it, vi } from 'vitest'
import { mount } from '@vue/test-utils'

import { Github, Loader2 } from 'lucide-vue-next'
import { User } from 'lucide-vue-next'
import { globalIcons } from '@vexip-ui/config'
import { Transfer } from '..'

import type { VueWrapper } from '@vue/test-utils'
Expand Down Expand Up @@ -182,24 +183,24 @@ describe('Transfer', () => {
const { source, target } = getPanels(wrapper)

expect(source.find('.vxp-transfer__loading').exists()).toBe(false)
expect(source.findComponent(Loader2).exists()).toBe(false)
expect(source.findComponent(globalIcons.value.loading.icon).exists()).toBe(false)
expect(target.find('.vxp-transfer__loading').exists()).toBe(false)
expect(target.findComponent(Loader2).exists()).toBe(false)
expect(target.findComponent(globalIcons.value.loading.icon).exists()).toBe(false)

await wrapper.setProps({ loading: true })
expect(source.find('.vxp-transfer__loading').exists()).toBe(true)
expect(source.findComponent(Loader2).exists()).toBe(true)
expect(source.findComponent(globalIcons.value.loading.icon).exists()).toBe(true)
expect(target.find('.vxp-transfer__loading').exists()).toBe(true)
expect(target.findComponent(Loader2).exists()).toBe(true)
expect(target.findComponent(globalIcons.value.loading.icon).exists()).toBe(true)
})

it('loading icon', () => {
const wrapper = mount(() => <Transfer loading loading-icon={Github}></Transfer>)
const wrapper = mount(() => <Transfer loading loading-icon={User}></Transfer>)
const { source, target } = getPanels(wrapper)

expect(source.findComponent(Loader2).exists()).toBe(false)
expect(source.findComponent(Github).exists()).toBe(true)
expect(target.findComponent(Loader2).exists()).toBe(false)
expect(target.findComponent(Github).exists()).toBe(true)
expect(source.findComponent(globalIcons.value.loading.icon).exists()).toBe(false)
expect(source.findComponent(User).exists()).toBe(true)
expect(target.findComponent(globalIcons.value.loading.icon).exists()).toBe(false)
expect(target.findComponent(User).exists()).toBe(true)
})
})
4 changes: 0 additions & 4 deletions dev-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
"scripts": {
"serve": "vite"
},
"dependencies": {
"vue": "^3.4.21",
"vue-router": "^4.3.0"
},
"devDependencies": {
"autoprefixer": "^10.4.19",
"postcss": "^8.4.38",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
"vite": "^5.2.8",
"vite-plugin-dts": "^3.8.2",
"vitest": "1.1.3",
"vue": "^3.4.21",
"vue": "~3.3.13",
"vue-router": "^4.3.0"
},
"peerDependencies": {
Expand Down
Loading

0 comments on commit 8b4c2bb

Please sign in to comment.