Browse Source

fix: the spin component loads for the first time #174

pull/179/head
wangxueliang 6 years ago
parent
commit
85a9aca492
  1. 19
      components/list/__tests__/index.test.js
  2. 2
      components/spin/Spin.jsx
  3. 10
      components/transfer/__tests__/__snapshots__/demo.test.js.snap
  4. 1
      components/transfer/demo/large-data.md

19
components/list/__tests__/index.test.js

@ -0,0 +1,19 @@
import { mount } from '@vue/test-utils'
import { asyncExpect } from '@/tests/utils'
import List from '..'
describe('List', () => {
it('locale not passed to internal div', async () => {
const locale = { emptyText: 'Custom text' }
const wrapper = mount({
render () {
return <List dataSource={[]} renderItem={(item) => <List.Item>{item}</List.Item>} locale={locale} />
},
}, {
sync: false,
})
await asyncExpect(() => {
expect(wrapper.props().locale).toBe(undefined)
})
})
})

2
components/spin/Spin.jsx

@ -148,7 +148,7 @@ export default {
return (
<transition-group
{...getTransitionProps('fade')}
{...getTransitionProps('fade', { appear: false })}
tag='div'
class={animateClassName}
>

10
components/transfer/__tests__/__snapshots__/demo.test.js.snap

@ -140,7 +140,10 @@ exports[`renders ./components/transfer/demo/large-data.md correctly 1`] = `
<div class="ant-transfer">
<div class="ant-transfer-list">
<div class="ant-transfer-list-header"><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span></label><span class="ant-transfer-list-header-selected"><span>2000 items</span><span class="ant-transfer-list-header-title"></span></span></div>
<div class="ant-transfer-list-body">
<div class="ant-transfer-list-body ant-transfer-list-body-with-search">
<div class="ant-transfer-list-body-search-wrapper">
<div><input value="" placeholder="Search here" type="text" class="ant-input ant-transfer-list-search ant-transfer-list-search"><span class="ant-transfer-list-search-action"><i class="anticon anticon-search"></i></span></div>
</div>
<ul class="ant-transfer-list-content">
<div class="LazyLoad" style="height: 32px;"></div>
<div class="LazyLoad" style="height: 32px;"></div>
@ -2149,7 +2152,10 @@ exports[`renders ./components/transfer/demo/large-data.md correctly 1`] = `
<div class="ant-transfer-operation"><button type="button" disabled="disabled" class="ant-btn ant-btn-primary ant-btn-sm"><i class="anticon anticon-right"></i></button><button type="button" disabled="disabled" class="ant-btn ant-btn-primary ant-btn-sm"><i class="anticon anticon-left"></i></button></div>
<div class="ant-transfer-list">
<div class="ant-transfer-list-header"><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span></label><span class="ant-transfer-list-header-selected"><span>0 item</span><span class="ant-transfer-list-header-title"></span></span></div>
<div class="ant-transfer-list-body">
<div class="ant-transfer-list-body ant-transfer-list-body-with-search">
<div class="ant-transfer-list-body-search-wrapper">
<div><input value="" placeholder="Search here" type="text" class="ant-input ant-transfer-list-search ant-transfer-list-search"><span class="ant-transfer-list-search-action"><i class="anticon anticon-search"></i></span></div>
</div>
<ul class="ant-transfer-list-content"></ul>
<div class="ant-transfer-list-body-not-found">Not Found</div>
</div>

1
components/transfer/demo/large-data.md

@ -15,6 +15,7 @@
:targetKeys="targetKeys"
@change="handleChange"
:render="item=>item.title"
showSearch
>
</a-transfer>
</template>

Loading…
Cancel
Save