From 9e10a100b3ceca1cfc3b3f04b7dee7a6f4473f90 Mon Sep 17 00:00:00 2001 From: bymyself Date: Sun, 3 May 2026 01:37:00 -0700 Subject: [PATCH] fix: avoid false-positive testing-library/prefer-presence-queries The eslint-plugin-testing-library prefer-presence-queries rule auto-fixes `service.getById(...)` to `service.queryById(...)` when inside `expect(...).toBeNull()`, mistaking our service method for a Testing Library query. Extracting the call into a variable breaks the pattern match without changing semantics or the public API. --- .../downloads/providers/createBrowserDownloadService.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platform/downloads/providers/createBrowserDownloadService.test.ts b/src/platform/downloads/providers/createBrowserDownloadService.test.ts index 296e49f7c9..4b18e6e09e 100644 --- a/src/platform/downloads/providers/createBrowserDownloadService.test.ts +++ b/src/platform/downloads/providers/createBrowserDownloadService.test.ts @@ -48,7 +48,8 @@ describe('createBrowserDownloadService', () => { it('getById returns null', () => { const service = createBrowserDownloadService() - expect(service.getById('anything')).toBeNull() + const entry = service.getById('anything') + expect(entry).toBeNull() }) it('onProgress returns a no-op unsubscribe', () => {