Skip to content

Commit

Permalink
More robust tests
Browse files Browse the repository at this point in the history
Co-authored-by: gabalafou <gabriel@fouasnon.com>
  • Loading branch information
fcollonval and gabalafou committed May 29, 2024
1 parent c43a568 commit e96e2e3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
16 changes: 8 additions & 8 deletions packages/widgets/tests/src/menu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -813,8 +813,8 @@ describe('@lumino/widgets', () => {
menu.node.dispatchEvent(
new MouseEvent('mousemove', {
bubbles,
clientX: rect.left,
clientY: rect.top
clientX: rect.left + 1,
clientY: rect.top + 1
})
);
expect(menu.activeIndex).to.equal(0);
Expand All @@ -831,8 +831,8 @@ describe('@lumino/widgets', () => {
menu.node.dispatchEvent(
new MouseEvent('mousemove', {
bubbles,
clientX: rect.left,
clientY: rect.top
clientX: rect.left + 1,
clientY: rect.top + 1
})
);
expect(menu.activeIndex).to.equal(0);
Expand Down Expand Up @@ -882,8 +882,8 @@ describe('@lumino/widgets', () => {
menu.node.dispatchEvent(
new MouseEvent('mousemove', {
bubbles,
clientX: rect.left,
clientY: rect.top
clientX: rect.left + 1,
clientY: rect.top + 1
})
);
expect(menu.activeIndex).to.equal(0);
Expand All @@ -908,8 +908,8 @@ describe('@lumino/widgets', () => {
menu.node.dispatchEvent(
new MouseEvent('mousedown', {
bubbles,
clientX: rect.left,
clientY: rect.top
clientX: rect.left + 1,
clientY: rect.top + 1
})
);
expect(menu.isAttached).to.equal(true);
Expand Down
18 changes: 9 additions & 9 deletions packages/widgets/tests/src/menubar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -734,8 +734,8 @@ describe('@lumino/widgets', () => {
let mouseEvent = new MouseEvent('mousedown', {
bubbles,
cancelable: true,
clientX: rect.left,
clientY: rect.top
clientX: rect.left + 1,
clientY: rect.top + 1
});
expect(bar.activeIndex).to.equal(0);
bar.node.dispatchEvent(mouseEvent);
Expand All @@ -755,8 +755,8 @@ describe('@lumino/widgets', () => {
let mouseEvent = new MouseEvent('mousedown', {
bubbles,
cancelable: true,
clientX: rect.left,
clientY: rect.top
clientX: rect.left + 1,
clientY: rect.top + 1
});
bar.node.dispatchEvent(mouseEvent);
expect(bar.activeIndex).to.equal(0);
Expand All @@ -779,8 +779,8 @@ describe('@lumino/widgets', () => {
new MouseEvent('mousedown', {
bubbles,
button: 1,
clientX: rect.left,
clientY: rect.top
clientX: rect.left + 1,
clientY: rect.top + 1
})
);
expect(bar.activeIndex).to.equal(0);
Expand All @@ -801,8 +801,8 @@ describe('@lumino/widgets', () => {
new MouseEvent('mousedown', {
bubbles,
button: 0,
clientX: rect.left,
clientY: rect.top
clientX: rect.left + 1,
clientY: rect.top + 1
})
);
expect(bar.activeIndex).to.equal(-1);
Expand All @@ -822,7 +822,7 @@ describe('@lumino/widgets', () => {
new MouseEvent('mousemove', {
bubbles,
clientX: rect.left + 1,
clientY: rect.top
clientY: rect.top + 1
})
);
expect(bar.activeIndex).to.equal(1);
Expand Down

0 comments on commit e96e2e3

Please sign in to comment.