mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
fix: correct createMockWidget calls in placeholder tests
The placeholder tests were calling createMockWidget with two positional args (value, options) but the function accepts a single object arg. The second argument was silently ignored, causing tests to fail. Also adds explicit generic type to fix TypeScript narrowing errors.
This commit is contained in:
@@ -351,9 +351,12 @@ describe('WidgetSelect Value Binding', () => {
|
||||
|
||||
describe('Empty options with placeholder', () => {
|
||||
it('shows placeholder when options are empty', () => {
|
||||
const widget = createMockWidget('', {
|
||||
values: [],
|
||||
placeholder: 'No models found in ComfyUI/models/checkpoints folder...'
|
||||
const widget = createMockWidget<string | undefined>({
|
||||
value: '',
|
||||
options: {
|
||||
values: [],
|
||||
placeholder: 'No models found in ComfyUI/models/checkpoints folder...'
|
||||
}
|
||||
})
|
||||
const wrapper = mountComponent(widget, '')
|
||||
const selectDefault = wrapper.findComponent(WidgetSelectDefault)
|
||||
@@ -365,9 +368,12 @@ describe('WidgetSelect Value Binding', () => {
|
||||
})
|
||||
|
||||
it('does not show placeholder when options exist', () => {
|
||||
const widget = createMockWidget('option1', {
|
||||
values: ['option1', 'option2'],
|
||||
placeholder: 'No models found'
|
||||
const widget = createMockWidget<string | undefined>({
|
||||
value: 'option1',
|
||||
options: {
|
||||
values: ['option1', 'option2'],
|
||||
placeholder: 'No models found'
|
||||
}
|
||||
})
|
||||
const wrapper = mountComponent(widget, 'option1')
|
||||
const selectDefault = wrapper.findComponent(WidgetSelectDefault)
|
||||
|
||||
Reference in New Issue
Block a user