mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 19:21:54 +00:00
[test] Update PackVersionBadge test to use role selector instead of Button component
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import { VueWrapper, mount } from '@vue/test-utils'
|
import { VueWrapper, mount } from '@vue/test-utils'
|
||||||
import { createPinia } from 'pinia'
|
import { createPinia } from 'pinia'
|
||||||
import Button from 'primevue/button'
|
|
||||||
import PrimeVue from 'primevue/config'
|
import PrimeVue from 'primevue/config'
|
||||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||||
import { nextTick } from 'vue'
|
import { nextTick } from 'vue'
|
||||||
@@ -118,9 +117,9 @@ describe('PackVersionBadge', () => {
|
|||||||
props: { nodePack: noVersionPack }
|
props: { nodePack: noVersionPack }
|
||||||
})
|
})
|
||||||
|
|
||||||
const button = wrapper.findComponent(Button)
|
const badge = wrapper.find('[role="button"]')
|
||||||
expect(button.exists()).toBe(true)
|
expect(badge.exists()).toBe(true)
|
||||||
expect(button.props('label')).toBe('nightly')
|
expect(badge.find('span').text()).toBe('nightly')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('falls back to NIGHTLY when nodePack.id is missing', () => {
|
it('falls back to NIGHTLY when nodePack.id is missing', () => {
|
||||||
@@ -132,9 +131,9 @@ describe('PackVersionBadge', () => {
|
|||||||
props: { nodePack: invalidPack }
|
props: { nodePack: invalidPack }
|
||||||
})
|
})
|
||||||
|
|
||||||
const button = wrapper.findComponent(Button)
|
const badge = wrapper.find('[role="button"]')
|
||||||
expect(button.exists()).toBe(true)
|
expect(badge.exists()).toBe(true)
|
||||||
expect(button.props('label')).toBe('nightly')
|
expect(badge.find('span').text()).toBe('nightly')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('toggles the popover when button is clicked', async () => {
|
it('toggles the popover when button is clicked', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user