Skip to content

Commit

Permalink
fix(test): fixed failing unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Zherdetska Alona, IT21.1 committed Oct 8, 2024
1 parent 09cfb8f commit 617ce4d
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,12 @@ export class PostMainNavigation implements HasDropdown, IsFocusable {
this.mouseLeaveTimer = null;
}

if (window.innerWidth >= 1024 && level.flyout.length > 0 && this.activeFlyout !== level.id) {
if (
window.innerWidth >= 1024 &&
level.flyout &&
level.flyout.length > 0 &&
this.activeFlyout !== level.id
) {
// Delay opening the flyout for a moment to give users a chance to move the mouse over the navigation without triggering the flyout
this.mouseEnterTimer = window.setTimeout(() => {
this.mouseEnterTimer = null;
Expand All @@ -163,7 +168,7 @@ export class PostMainNavigation implements HasDropdown, IsFocusable {
return;
}

if (window.innerWidth >= 1024 && level.flyout.length > 0) {
if (window.innerWidth >= 1024 && level.flyout && level.flyout.length > 0) {
// Allow the pointer to shortly leave the flyout without closing it. This
// allows for user mistakes and makes the experience less nervous
this.mouseLeaveTimer = window.setTimeout(() => {
Expand Down

0 comments on commit 617ce4d

Please sign in to comment.