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:
bymyself
2026-03-12 12:33:57 -07:00
parent 9ba77af763
commit a842be2871

View File

@@ -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)