test: menu test error

pull/6067/head
tangjinzhou 2 years ago
parent 9eac1a1da5
commit fcca4baefe

@ -97,7 +97,7 @@ describe('Menu', () => {
{ attachTo: 'body', sync: false },
);
await asyncExpect(() => {
expect($$('.ant-menu-sub')[0].parentElement.style.display).not.toBe('none');
expect($$('ul.ant-menu-sub')[0].style.display).not.toBe('none');
});
});
@ -119,7 +119,7 @@ describe('Menu', () => {
{ attachTo: 'body', sync: false },
);
await asyncExpect(() => {
expect($$('.ant-menu-sub')[0].parentElement.style.display).not.toBe('none');
expect($$('.ant-menu-submenu-popup')[0].style.display).not.toBe('none');
}, 100);
});
@ -149,14 +149,14 @@ describe('Menu', () => {
{ attachTo: 'body', sync: false },
);
await sleep(100);
expect($$('.ant-menu-sub')[0].parentElement.style.display).not.toBe('none');
expect($$('.ant-menu-submenu-popup')[0].style.display).not.toBe('none');
wrapper.setProps({ openKeys: [] });
await sleep(100);
expect($$('.ant-menu-sub')[0].parentElement.style.display).toBe('none');
expect($$('.ant-menu-submenu-popup')[0].style.display).toBe('none');
await sleep(100);
wrapper.setProps({ openKeys: ['1'] });
await sleep(100);
expect($$('.ant-menu-sub')[0].parentElement.style.display).not.toBe('none');
expect($$('.ant-menu-submenu-popup')[0].style.display).not.toBe('none');
});
// it('inline', async () => {
@ -219,15 +219,15 @@ describe('Menu', () => {
{ attachTo: 'body', sync: false },
);
await asyncExpect(() => {
expect($$('.ant-menu-sub')[0].parentElement.style.display).not.toBe('none');
expect($$('.ant-menu-submenu-popup')[0].style.display).not.toBe('none');
}, 100);
wrapper.setProps({ openKeys: [] });
await asyncExpect(() => {
expect($$('.ant-menu-sub')[0].parentElement.style.display).toBe('none');
expect($$('.ant-menu-submenu-popup')[0].style.display).toBe('none');
}, 500);
wrapper.setProps({ openKeys: ['1'] });
await asyncExpect(() => {
expect($$('.ant-menu-sub')[0].parentElement.style.display).not.toBe('none');
expect($$('.ant-menu-submenu-popup')[0].style.display).not.toBe('none');
}, 100);
});
@ -459,11 +459,11 @@ describe('Menu', () => {
// }, 0);
// await asyncExpect(() => {
// expect($$('.ant-menu-sub').length).toBe(1);
// expect($$('.ant-menu-sub')[0].parentElement.style.display).not.toBe('none');
// expect($$('.ant-menu-submenu-popup')[0].style.display).not.toBe('none');
// toggleMenu(wrapper, 0, 'mouseleave');
// }, 500);
// await asyncExpect(() => {
// expect($$('.ant-menu-sub')[0].parentElement.style.display).toBe('none');
// expect($$('.ant-menu-submenu-popup')[0].style.display).toBe('none');
// }, 500);
// });
@ -490,11 +490,11 @@ describe('Menu', () => {
// }, 100);
// await asyncExpect(() => {
// expect($$('.ant-menu-sub').length).toBe(1);
// expect($$('.ant-menu-sub')[0].parentElement.style.display).not.toBe('none');
// expect($$('.ant-menu-submenu-popup')[0].style.display).not.toBe('none');
// toggleMenu(wrapper, 1, 'mouseleave');
// }, 500);
// await asyncExpect(() => {
// expect($$('.ant-menu-sub')[0].parentElement.style.display).toBe('none');
// expect($$('.ant-menu-submenu-popup')[0].style.display).toBe('none');
// }, 500);
// });
// });

Loading…
Cancel
Save