diff --git a/components/ui/__tests__/toast-layout.test.tsx b/components/ui/__tests__/toast-layout.test.tsx index a421af676..335d03634 100644 --- a/components/ui/__tests__/toast-layout.test.tsx +++ b/components/ui/__tests__/toast-layout.test.tsx @@ -208,6 +208,25 @@ describe('toasts and the focused element', () => { expect(toastContainer()).not.toHaveAttribute('data-dodging'); }); + // With the focus in the composer's text or the quick reply box, "Email + // sent" and "Sending in 5 seconds" moved to the top and covered the + // composer's close button and the reader's toolbar. A large field the + // stack only overlaps at a corner keeps the toasts at the bottom. + it('stays at the bottom over a corner of a large focused field', () => { + const h = window.innerHeight; + vi.spyOn(HTMLElement.prototype, 'getBoundingClientRect').mockImplementation(function (this: HTMLElement) { + if (this.hasAttribute('data-toast-container')) return rect(h - 100, 600, 360, 80); + if (this.id === 'body') return rect(h - 400, 300, 700, 360); + return rect(10, 10, 80, 36); + }); + render(<>