test(CountDown): fix test warning (#8046)

This commit is contained in:
neverland 2021-01-31 17:07:40 +08:00 committed by GitHub
parent 0d7ff429d9
commit f5381e4f5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
import { nextTick } from 'vue';
import { KeepAlive, nextTick } from 'vue';
import CountDown from '..';
import { mount, later } from '../../../test';
@ -178,11 +178,13 @@ test('should format S milliseconds correctly', () => {
test('should pause counting when deactivated', async () => {
const wrapper = mount({
template: `
<keep-alive>
<van-count-down v-if="render" ref="countDown" time="100" />
</keep-alive>
`,
render() {
return (
<KeepAlive>
{this.render ? <CountDown ref="countDown" time="10000" /> : null}
</KeepAlive>
);
},
data() {
return {
render: true,