From ef823df8eb96878b550a08fb4016b2b33405a38c Mon Sep 17 00:00:00 2001 From: Nuwan Date: Tue, 21 Dec 2021 19:53:34 +0530 Subject: [PATCH] change header dropdown behaviour --- .../integration/layout/navigation.spec.js | 6 +++--- .../components/navbar/JKNotificationDropdown.js | 16 ++++++++-------- .../src/components/navbar/JKProfileDropdown.js | 16 ++++++++-------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/jam-ui/cypress/integration/layout/navigation.spec.js b/jam-ui/cypress/integration/layout/navigation.spec.js index a55806b81..89f493024 100644 --- a/jam-ui/cypress/integration/layout/navigation.spec.js +++ b/jam-ui/cypress/integration/layout/navigation.spec.js @@ -25,7 +25,7 @@ describe("Top Navigation", () => { showSubscribeToUpdates() }) - it("not allowed to projected page", () => { + it("not allowed to protected page", () => { cy.visit('/friends') cy.url().should('include', '/authentication/basic/login') cy.contains("Sign in") @@ -47,7 +47,7 @@ describe("Top Navigation", () => { }) it('sign out', () => { - cy.get('[data-testid=navbarTopProfileDropdown]').contains('Peter Pan').trigger('mouseover') + cy.get('[data-testid=navbarTopProfileDropdown]').contains('Peter Pan').click() cy.stubUnauthenticate() cy.get('[data-testid=navbarTopProfileDropdown]').contains('Sign Out').click() cy.get('[data-testid=navbarTopProfileDropdown]').should('not.exist') @@ -65,7 +65,7 @@ describe("Top Navigation", () => { it('shows notifications', () => { cy.get('[data-testid=notificationDropdown]').should('not.be.visible') - cy.get('.notification-indicator').trigger('mouseover') + cy.get('.notification-indicator').click() cy.get('[data-testid=notificationDropdown]').should('be.visible') cy.get('[data-testid=notificationDropdown] .list-group-item').should('have.length', 3) cy.get('[data-testid=notificationDropdown]').contains('View all').click() //view all notifications diff --git a/jam-ui/src/components/navbar/JKNotificationDropdown.js b/jam-ui/src/components/navbar/JKNotificationDropdown.js index 368738401..a884c3fb6 100644 --- a/jam-ui/src/components/navbar/JKNotificationDropdown.js +++ b/jam-ui/src/components/navbar/JKNotificationDropdown.js @@ -60,14 +60,14 @@ const JKNotificationDropdown = () => { className="mx-3" isOpen={isOpen} toggle={handleToggle} - onMouseOver={() => { - let windowWidth = window.innerWidth; - windowWidth > 992 && setIsOpen(true); - }} - onMouseLeave={() => { - let windowWidth = window.innerWidth; - windowWidth > 992 && setIsOpen(false); - }} + // onMouseOver={() => { + // let windowWidth = window.innerWidth; + // windowWidth > 992 && setIsOpen(true); + // }} + // onMouseLeave={() => { + // let windowWidth = window.innerWidth; + // windowWidth > 992 && setIsOpen(false); + // }} > { data-testid="navbarTopProfileDropdown" isOpen={dropdownOpen} toggle={toggle} - onMouseOver={() => { - let windowWidth = window.innerWidth; - windowWidth > 992 && setDropdownOpen(true); - }} - onMouseLeave={() => { - let windowWidth = window.innerWidth; - windowWidth > 992 && setDropdownOpen(false); - }} + // onMouseOver={() => { + // let windowWidth = window.innerWidth; + // windowWidth > 992 && setDropdownOpen(true); + // }} + // onMouseLeave={() => { + // let windowWidth = window.innerWidth; + // windowWidth > 992 && setDropdownOpen(false); + // }} >