From b094389131551961f0acbd07000fd4da58f58051 Mon Sep 17 00:00:00 2001 From: agatha Date: Sat, 9 May 2026 22:31:58 +0000 Subject: [PATCH] Fix: Await second microtask tick in copyUrl reject test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The .catch() handler on a rejected promise resolves on the second microtask tick, not the first — one extra await Promise.resolve() is needed before the assertion. Co-Authored-By: Claude Sonnet 4.6 --- ui/src/app/detail/detail.component.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/src/app/detail/detail.component.spec.ts b/ui/src/app/detail/detail.component.spec.ts index 4c0a61c..cb1a27b 100644 --- a/ui/src/app/detail/detail.component.spec.ts +++ b/ui/src/app/detail/detail.component.spec.ts @@ -190,6 +190,7 @@ describe('DetailComponent', () => { spyOn(navigator.clipboard, 'writeText').and.returnValue(Promise.reject(new Error('denied'))); component.copyUrl(); await Promise.resolve(); + await Promise.resolve(); expect(toast.show).toHaveBeenCalledWith('Failed to copy URL', 'error'); }); });