diff --git a/frontend/src/App.test.js b/frontend/src/App.test.js index d9907f4..f2721d3 100644 --- a/frontend/src/App.test.js +++ b/frontend/src/App.test.js @@ -19,3 +19,13 @@ describe("App reset password account picker", () => { assert.match(source, /formatResetPasswordUserLabel\(user\)/); }); }); + +describe("App user menu interactions", () => { + it("closes the avatar menu when the user clicks outside the menu shell", () => { + assert.match(source, /ref="userMenuShellRef"/); + assert.match(source, /function handleUserMenuOutsidePointerDown\(event\)/); + assert.match(source, /userMenuShellRef\.value\?\.contains\(event\.target\)/); + assert.match(source, /document\.addEventListener\("pointerdown", handleUserMenuOutsidePointerDown\)/); + assert.match(source, /document\.removeEventListener\("pointerdown", handleUserMenuOutsidePointerDown\)/); + }); +}); diff --git a/frontend/src/App.vue b/frontend/src/App.vue index d355211..4c4133c 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -110,7 +110,7 @@ -