From 96d3de77092fccbd6993b685b7a7d59d0e860588 Mon Sep 17 00:00:00 2001 From: Denys Koreiba Date: Mon, 9 Nov 2026 21:10:58 +0100 Subject: [PATCH] test(notes): align offline refresh with initial loading --- cypress/component/features/mobile/OfflineNotes.cy.tsx | 6 +++--- docs/ai/testing/feature-note-list-virtualization.md | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cypress/component/features/mobile/OfflineNotes.cy.tsx b/cypress/component/features/mobile/OfflineNotes.cy.tsx index c07fa4039aed..63fa7df274f1 100644 --- a/cypress/component/features/mobile/OfflineNotes.cy.tsx +++ b/cypress/component/features/mobile/OfflineNotes.cy.tsx @@ -209,11 +209,11 @@ describe('Refresh reconciles persisted cache before reopening notes', { retries: ])) const mountApp = () => cy.mount() mountApp() - // The first HTTP response is deliberately still pending when local cards must appear. - cy.contains('[data-testid="note-card"]', 'Deleted one', { timeout: 2000 }).should('be.visible') - cy.contains('[data-testid="note-card"]', 'Deleted two').should('be.visible') + // Online startup keeps the skeleton until the first page arrives, even with cached notes. cy.wrap(null).should(() => expect(listRequests).to.equal(1)) cy.wait('@initialCacheList') + cy.contains('[data-testid="note-card"]', 'Deleted one').should('be.visible') + cy.contains('[data-testid="note-card"]', 'Deleted two').should('be.visible') cy.get('[data-cy="pull-to-refresh"]').filter(':visible') .trigger('touchstart', { touches: [{ clientX: 80, clientY: 200 }] }) .trigger('touchmove', { touches: [{ clientX: 80, clientY: 350 }] }) diff --git a/docs/ai/testing/feature-note-list-virtualization.md b/docs/ai/testing/feature-note-list-virtualization.md index 98cf70181a3b..6832f4fc4ef7 100644 --- a/docs/ai/testing/feature-note-list-virtualization.md +++ b/docs/ai/testing/feature-note-list-virtualization.md @@ -62,3 +62,9 @@ Validation on 2026-11-09: Coverage is scoped to these loading transitions and adjacent grid interactions; line coverage was not measured. This fixture does not measure production network latency or verify a deployed build. +### Existing offline-refresh coverage + +PR #216 CI found an older `OfflineNotes.cy.tsx` assertion requiring cached cards within two seconds while the initial online response was delayed for five seconds. That startup expectation conflicts with the approved loading skeleton. The test now waits for the initial response before checking the cached cards; its swipe refresh, server-missing warning, persisted contents, pending draft, account ownership, and reopen assertions remain intact. + +Follow-up validation: all 11 cases in `NoteListInitialLoading.cy.tsx` and `OfflineNotes.cy.tsx` pass through Allure agent mode (exit 0; no findings, skips, or retries). ESLint for the changed test and `git diff --check` pass. This follow-up changes only test ordering and documentation; the application bundle and APK from merge commit `a86462d` are unchanged. +