tjz
7 years ago
3 changed files with 49 additions and 9 deletions
@ -0,0 +1,31 @@
|
||||
import { mount } from '@vue/test-utils' |
||||
import { asyncExpect } from '@/tests/utils' |
||||
import Search from '../Search' |
||||
import Button from '../../button' |
||||
import focusTest from '../../../tests/shared/focusTest' |
||||
|
||||
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() |
||||
}) |
||||
}) |
||||
}) |
@ -0,0 +1,9 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP |
||||
|
||||
exports[`Input.Search should support custom Button 1`] = ` |
||||
<span class="ant-input-search ant-input-search-enter-button ant-input-affix-wrapper ant-input-search ant-input-search-enter-button"><input type="text" class="ant-input ant-input-search ant-input-search-enter-button"><span class="ant-input-suffix"><button type="button" class="ant-btn ant-btn-default ant-input-search-button"><span>ok</span></button> |
||||
</span> |
||||
</span> |
||||
`; |
||||
|
||||
exports[`Input.Search should support custom button 1`] = `<span class="ant-input-search ant-input-search-enter-button ant-input-affix-wrapper ant-input-search ant-input-search-enter-button"><input type="text" class="ant-input ant-input-search ant-input-search-enter-button"><span class="ant-input-suffix"><button class="">ok</button></span></span>`; |
Loading…
Reference in new issue