You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
845 B
33 lines
845 B
import { mount } from '@vue/test-utils'
|
|
import { asyncExpect } from '@/tests/utils'
|
|
import Input from '../index'
|
|
import Button from '../../button'
|
|
import focusTest from '../../../tests/shared/focusTest'
|
|
|
|
const { Search } = Input
|
|
describe('Input.Search', () => {
|
|
focusTest(Search)
|
|
|
|
it('should support custom button', async () => {
|
|
const wrapper = mount({
|
|
render () {
|
|
return <Search enterButton={<button>ok</button>} />
|
|
},
|
|
}, { sync: false })
|
|
await asyncExpect(() => {
|
|
expect(wrapper.html()).toMatchSnapshot()
|
|
})
|
|
})
|
|
|
|
it('should support custom Button', async () => {
|
|
const wrapper = mount({
|
|
render () {
|
|
return <Search enterButton={<Button>ok</Button>} />
|
|
},
|
|
}, { sync: false })
|
|
await asyncExpect(() => {
|
|
expect(wrapper.html()).toMatchSnapshot()
|
|
})
|
|
})
|
|
})
|