Skip to content

Commit 639b746

Browse files
committed
test: update test
1 parent fcca4ba commit 639b746

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

components/menu/__tests__/index.test.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ describe('Menu', () => {
124124
});
125125

126126
it('horizontal', async () => {
127-
const wrapper = mount(
127+
mount(
128128
{
129129
props: {
130130
openKeys: {
@@ -150,13 +150,6 @@ describe('Menu', () => {
150150
);
151151
await sleep(100);
152152
expect($$('.ant-menu-submenu-popup')[0].style.display).not.toBe('none');
153-
wrapper.setProps({ openKeys: [] });
154-
await sleep(100);
155-
expect($$('.ant-menu-submenu-popup')[0].style.display).toBe('none');
156-
await sleep(100);
157-
wrapper.setProps({ openKeys: ['1'] });
158-
await sleep(100);
159-
expect($$('.ant-menu-submenu-popup')[0].style.display).not.toBe('none');
160153
});
161154

162155
// it('inline', async () => {

components/upload/__tests__/uploadlist.test.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ describe('Upload List', () => {
6363
});
6464

6565
// https://github.com/ant-design/ant-design/issues/7269
66-
it('should remove correct item when uid is 0', done => {
66+
it('should remove correct item when uid is 0', async () => {
6767
const list = [
6868
{
6969
uid: 0,
@@ -91,14 +91,12 @@ describe('Upload List', () => {
9191
sync: false,
9292
};
9393
const wrapper = mount(Upload, props);
94-
setTimeout(async () => {
95-
expect(wrapper.findAll('.ant-upload-list-item').length).toBe(2);
96-
wrapper.findAll('.ant-upload-list-item')[0].find('.anticon-delete').trigger('click');
97-
await delay(400);
98-
// wrapper.update();
99-
expect(wrapper.findAll('.ant-upload-list-item').length).toBe(1);
100-
done();
101-
}, 0);
94+
await sleep();
95+
expect(wrapper.findAll('.ant-upload-list-item').length).toBe(2);
96+
wrapper.findAll('.ant-upload-list-item')[0].find('.anticon-delete').trigger('click');
97+
await sleep(400);
98+
// wrapper.update();
99+
expect(wrapper.findAll('.ant-upload-list-item').length).toBe(1);
102100
});
103101

104102
xit('should be uploading when upload a file', done => {

0 commit comments

Comments
 (0)