Skip to content

Commit fcca4ba

Browse files
committed
test: menu test error
1 parent 9eac1a1 commit fcca4ba

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

components/menu/__tests__/index.test.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ describe('Menu', () => {
9797
{ attachTo: 'body', sync: false },
9898
);
9999
await asyncExpect(() => {
100-
expect($$('.ant-menu-sub')[0].parentElement.style.display).not.toBe('none');
100+
expect($$('ul.ant-menu-sub')[0].style.display).not.toBe('none');
101101
});
102102
});
103103

@@ -119,7 +119,7 @@ describe('Menu', () => {
119119
{ attachTo: 'body', sync: false },
120120
);
121121
await asyncExpect(() => {
122-
expect($$('.ant-menu-sub')[0].parentElement.style.display).not.toBe('none');
122+
expect($$('.ant-menu-submenu-popup')[0].style.display).not.toBe('none');
123123
}, 100);
124124
});
125125

@@ -149,14 +149,14 @@ describe('Menu', () => {
149149
{ attachTo: 'body', sync: false },
150150
);
151151
await sleep(100);
152-
expect($$('.ant-menu-sub')[0].parentElement.style.display).not.toBe('none');
152+
expect($$('.ant-menu-submenu-popup')[0].style.display).not.toBe('none');
153153
wrapper.setProps({ openKeys: [] });
154154
await sleep(100);
155-
expect($$('.ant-menu-sub')[0].parentElement.style.display).toBe('none');
155+
expect($$('.ant-menu-submenu-popup')[0].style.display).toBe('none');
156156
await sleep(100);
157157
wrapper.setProps({ openKeys: ['1'] });
158158
await sleep(100);
159-
expect($$('.ant-menu-sub')[0].parentElement.style.display).not.toBe('none');
159+
expect($$('.ant-menu-submenu-popup')[0].style.display).not.toBe('none');
160160
});
161161

162162
// it('inline', async () => {
@@ -219,15 +219,15 @@ describe('Menu', () => {
219219
{ attachTo: 'body', sync: false },
220220
);
221221
await asyncExpect(() => {
222-
expect($$('.ant-menu-sub')[0].parentElement.style.display).not.toBe('none');
222+
expect($$('.ant-menu-submenu-popup')[0].style.display).not.toBe('none');
223223
}, 100);
224224
wrapper.setProps({ openKeys: [] });
225225
await asyncExpect(() => {
226-
expect($$('.ant-menu-sub')[0].parentElement.style.display).toBe('none');
226+
expect($$('.ant-menu-submenu-popup')[0].style.display).toBe('none');
227227
}, 500);
228228
wrapper.setProps({ openKeys: ['1'] });
229229
await asyncExpect(() => {
230-
expect($$('.ant-menu-sub')[0].parentElement.style.display).not.toBe('none');
230+
expect($$('.ant-menu-submenu-popup')[0].style.display).not.toBe('none');
231231
}, 100);
232232
});
233233

@@ -459,11 +459,11 @@ describe('Menu', () => {
459459
// }, 0);
460460
// await asyncExpect(() => {
461461
// expect($$('.ant-menu-sub').length).toBe(1);
462-
// expect($$('.ant-menu-sub')[0].parentElement.style.display).not.toBe('none');
462+
// expect($$('.ant-menu-submenu-popup')[0].style.display).not.toBe('none');
463463
// toggleMenu(wrapper, 0, 'mouseleave');
464464
// }, 500);
465465
// await asyncExpect(() => {
466-
// expect($$('.ant-menu-sub')[0].parentElement.style.display).toBe('none');
466+
// expect($$('.ant-menu-submenu-popup')[0].style.display).toBe('none');
467467
// }, 500);
468468
// });
469469

@@ -490,11 +490,11 @@ describe('Menu', () => {
490490
// }, 100);
491491
// await asyncExpect(() => {
492492
// expect($$('.ant-menu-sub').length).toBe(1);
493-
// expect($$('.ant-menu-sub')[0].parentElement.style.display).not.toBe('none');
493+
// expect($$('.ant-menu-submenu-popup')[0].style.display).not.toBe('none');
494494
// toggleMenu(wrapper, 1, 'mouseleave');
495495
// }, 500);
496496
// await asyncExpect(() => {
497-
// expect($$('.ant-menu-sub')[0].parentElement.style.display).toBe('none');
497+
// expect($$('.ant-menu-submenu-popup')[0].style.display).toBe('none');
498498
// }, 500);
499499
// });
500500
// });

0 commit comments

Comments
 (0)