Skip to content

Commit f0d948f

Browse files
authored
test: fix incorrect sub-menu reference in items theme tests (#6890)
1 parent a5f1dbd commit f0d948f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/context-menu/test/items-theme.test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('items theme', () => {
4747
await openMenu(getMenuItems(rootMenu)[0]);
4848
subMenu = getSubMenu(rootMenu);
4949
await openMenu(getMenuItems(subMenu)[1]);
50-
subMenu2 = getSubMenu(rootMenu);
50+
subMenu2 = getSubMenu(subMenu);
5151
});
5252

5353
afterEach(() => {
@@ -80,6 +80,7 @@ describe('items theme', () => {
8080

8181
// Should wait until submenus will be opened again.
8282
await nextFrame();
83+
await openMenu(target);
8384
await openMenu(getMenuItems(rootMenu)[0]);
8485
await openMenu(getMenuItems(subMenu)[1]);
8586

@@ -152,7 +153,7 @@ describe('items theme', () => {
152153
});
153154

154155
it('should not remove theme provided on the item component', () => {
155-
const item = getMenuItems(subMenu2)[2];
156+
const item = getMenuItems(subMenu)[2];
156157
expect(item.getAttribute('theme')).to.equal('bar');
157158
});
158159

@@ -163,7 +164,7 @@ describe('items theme', () => {
163164

164165
await openMenu(getMenuItems(rootMenu)[0]);
165166

166-
const item = getMenuItems(subMenu2)[2];
167+
const item = getMenuItems(subMenu)[2];
167168

168169
expect(item.getAttribute('theme')).to.equal('bar-1');
169170
});

0 commit comments

Comments
 (0)