Skip to content

Commit 1bd856c

Browse files
committed
update test
1 parent f57674b commit 1bd856c

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

test/unit/specs/date-picker.spec.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2832,7 +2832,7 @@ describe('DatePicker', () => {
28322832
});
28332833
});
28342834
describe('picker-options:className', () => {
2835-
it('set custom class name', done => {
2835+
it('set custom class name', async() => {
28362836
vm = createVue({
28372837
template: '<el-date-picker type="datetime" v-model="value" ref="compo" :pickerOptions="pickerOptions" />',
28382838
data() {
@@ -2845,15 +2845,11 @@ describe('DatePicker', () => {
28452845
}
28462846
}, true);
28472847
vm.$refs.compo.$el.querySelector('input').focus();
2848-
setTimeout(_ => {
2849-
setTimeout(_ => {
2850-
expect(
2851-
(vm.$refs.compo.picker.$el.querySelector('.el-date-table__row td').className)
2852-
.indexOf('test-class') > -1
2853-
).to.be.true;
2854-
done();
2855-
}, DELAY);
2856-
}, DELAY);
2848+
await wait();
2849+
expect(
2850+
(vm.$refs.compo.picker.$el.querySelector('.el-date-table__row td').className)
2851+
.indexOf('test-class') > -1
2852+
).to.be.true;
28572853
});
28582854
});
28592855
});

0 commit comments

Comments
 (0)