mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-03 04:31:58 +00:00
refactor: migrate buildTooltipConfig consumers to BaseTooltip (#10378)
PR 2 in the tooltip migration series. Migrates all `buildTooltipConfig` consumers from PrimeVue `v-tooltip` directive to the new Reka UI `BaseTooltip` component. - Replace `v-tooltip` + `buildTooltipConfig` with `<BaseTooltip>` wrapper in 8 component files - Remove computed wrappers that only existed for tooltip config - Delete `src/composables/useTooltipConfig.ts` (no remaining consumers) - Update 7 test files: replace tooltip directive stubs with `BaseTooltip` component stubs 1. **PR 1** (base): Add `BaseTooltip` component using Reka UI 2. **PR 2** (this): Migrate `buildTooltipConfig` consumers (small variant) 3. PR 3: Migrate remaining PrimeVue `v-tooltip` usages (Style 1) 4. PR 4: Remove PrimeVue tooltip directive registration - [x] `pnpm typecheck` passes - [x] `pnpm lint:fix` passes - [x] `pnpm format` passes - [x] `pnpm test:unit` passes (529 files, 7022 tests) ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-10378-refactor-migrate-buildTooltipConfig-consumers-to-BaseTooltip-32a6d73d3650812980c4d8b259fb502c) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -48,11 +48,9 @@ vi.mock('@/stores/workspace/sidebarTabStore', () => ({
|
||||
}))
|
||||
|
||||
import QueueOverlayHeader from './QueueOverlayHeader.vue'
|
||||
import * as tooltipConfig from '@/composables/useTooltipConfig'
|
||||
|
||||
const tooltipDirectiveStub = {
|
||||
mounted: vi.fn(),
|
||||
updated: vi.fn()
|
||||
const BaseTooltipStub = {
|
||||
template: '<slot />'
|
||||
}
|
||||
|
||||
const mountHeader = (props = {}) =>
|
||||
@@ -64,7 +62,9 @@ const mountHeader = (props = {}) =>
|
||||
},
|
||||
global: {
|
||||
plugins: [i18n],
|
||||
directives: { tooltip: tooltipDirectiveStub }
|
||||
stubs: {
|
||||
BaseTooltip: BaseTooltipStub
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -105,14 +105,11 @@ describe('QueueOverlayHeader', () => {
|
||||
})
|
||||
|
||||
it('emits clear history from the menu', async () => {
|
||||
const spy = vi.spyOn(tooltipConfig, 'buildTooltipConfig')
|
||||
|
||||
const wrapper = mountHeader()
|
||||
|
||||
expect(wrapper.find('button[aria-label="More options"]').exists()).toBe(
|
||||
true
|
||||
)
|
||||
expect(spy).toHaveBeenCalledWith('More')
|
||||
|
||||
const clearHistoryButton = wrapper.get(
|
||||
'[data-testid="clear-history-action"]'
|
||||
|
||||
Reference in New Issue
Block a user