Skip to content

Commit a45d2c2

Browse files
xingyan95kagol
authored andcommitted
fix(Modal): 修复单元测试报错
1 parent 2c0521a commit a45d2c2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/devui-vue/devui/modal/__tests__/modal.spec.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('d-modal', () => {
2828
overlayAnchor && document.body.removeChild(overlayAnchor);
2929
});
3030
it('render correctly', async () => {
31-
const visible = ref(false);
31+
const visible = ref(true);
3232
const wrapper = mount({
3333
setup() {
3434
return () => (
@@ -47,7 +47,6 @@ describe('d-modal', () => {
4747
},
4848
});
4949

50-
visible.value = true;
5150
await wait(100);
5251
await nextTick();
5352
const modal = document.querySelector(ns.b());
@@ -85,6 +84,8 @@ describe('d-modal', () => {
8584
},
8685
});
8786

87+
await wait(100);
88+
await nextTick();
8889
visible.value = true;
8990
await wait(100);
9091
await nextTick();
@@ -121,6 +122,8 @@ describe('d-modal', () => {
121122
},
122123
});
123124

125+
await wait(100);
126+
await nextTick();
124127
visible.value = true;
125128
await wait(100);
126129
await nextTick();
@@ -152,6 +155,8 @@ describe('d-modal', () => {
152155
},
153156
});
154157

158+
await wait(100);
159+
await nextTick();
155160
visible.value = true;
156161
await wait(100);
157162
await nextTick();

0 commit comments

Comments
 (0)