diff --git a/toolkit/components/passwordmgr/test/browser/browser_preselect_login.js b/toolkit/components/passwordmgr/test/browser/browser_preselect_login.js index 7cd9f2c8d2078..53a1b5d48c59f 100644 --- a/toolkit/components/passwordmgr/test/browser/browser_preselect_login.js +++ b/toolkit/components/passwordmgr/test/browser/browser_preselect_login.js @@ -216,3 +216,32 @@ add_task(async function test_new_login_url_has_correct_hash() { } ); }); + +add_task(async function test_no_logins_empty_url_hash() { + Services.logins.removeAllUserFacingLogins(); + await BrowserTestUtils.withNewTab( + { + gBrowser, + url: TEST_URL_PATH, + }, + async function () { + await waitForAppMenu(); + + const appMenuPasswordsButton = document.getElementById( + "appMenu-passwords-button" + ); + + const aboutLoginsTabPromise = BrowserTestUtils.waitForNewTab( + gBrowser, + url => new URL(url).hash === "", + true + ); + + EventUtils.synthesizeMouseAtCenter(appMenuPasswordsButton, {}); + + const aboutLoginsTab = await aboutLoginsTabPromise; + + gBrowser.removeTab(aboutLoginsTab); + } + ); +});