Validate on mount for UrlInput (#2332)

This commit is contained in:
Chenlei Hu
2025-01-23 15:09:00 -05:00
committed by GitHub
parent e8136ff0ae
commit caad27e28d
2 changed files with 21 additions and 5 deletions

View File

@@ -94,4 +94,16 @@ describe('UrlInput', () => {
expect(wrapper.find('.pi-times').exists()).toBe(true)
})
it('validates on mount', async () => {
const wrapper = mountComponent({
modelValue: 'https://test.com',
validateUrlFn: () => Promise.resolve(true)
})
await nextTick()
await nextTick()
expect(wrapper.find('.pi-check').exists()).toBe(true)
})
})