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