Browse Source

Merge pull request #2281 from cheahjs/fix/settings-cypress

fix: settings cypress test after style changes
Timothy Jaeryang Baek 11 months ago
parent
commit
ea812a3bb8
2 changed files with 3 additions and 6 deletions
  1. 2 6
      cypress/e2e/settings.cy.ts
  2. 1 0
      src/lib/components/layout/Navbar.svelte

+ 2 - 6
cypress/e2e/settings.cy.ts

@@ -15,12 +15,8 @@ describe('Settings', () => {
 		cy.loginAdmin();
 		cy.loginAdmin();
 		// Visit the home page
 		// Visit the home page
 		cy.visit('/');
 		cy.visit('/');
-		// Open the sidebar if it is not already open
-		cy.get('[aria-label="Open sidebar"]').then(() => {
-			cy.get('button[id="sidebar-toggle-button"]').click();
-		});
-		// Click on the profile link
-		cy.get('button').contains(adminUser.name).click();
+		// Click on the user menu
+		cy.get('button[aria-label="User Menu"]').click();
 		// Click on the settings link
 		// Click on the settings link
 		cy.get('button').contains('Settings').click();
 		cy.get('button').contains('Settings').click();
 	});
 	});

+ 1 - 0
src/lib/components/layout/Navbar.svelte

@@ -141,6 +141,7 @@
 					>
 					>
 						<button
 						<button
 							class=" flex rounded-xl p-1.5 w-full hover:bg-gray-100 dark:hover:bg-gray-850 transition"
 							class=" flex rounded-xl p-1.5 w-full hover:bg-gray-100 dark:hover:bg-gray-850 transition"
+							aria-label="User Menu"
 						>
 						>
 							<div class=" self-center">
 							<div class=" self-center">
 								<img
 								<img