aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/client/sync/pull.test.ts
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-12-07 23:34:03 +0900
committernsfisis <nsfisis@gmail.com>2025-12-07 23:34:03 +0900
commit0c042ac89fc0822fcbe09c48702857faa5494ae1 (patch)
treeea1f1d180f747613343040d441a07f92b2760840 /src/client/sync/pull.test.ts
parentae5a0bb97fbf013417a6962f7e077f0408b2a951 (diff)
downloadkioku-0c042ac89fc0822fcbe09c48702857faa5494ae1.tar.gz
kioku-0c042ac89fc0822fcbe09c48702857faa5494ae1.tar.zst
kioku-0c042ac89fc0822fcbe09c48702857faa5494ae1.zip
feat(client): add sync status indicator component
Add SyncStatusIndicator component to display current sync state in the UI header. The component shows online/offline status, syncing progress, pending changes count, and sync errors. - Create SyncProvider context to wrap SyncManager for React components - Add SyncStatusIndicator component with visual status indicators - Integrate indicator into HomePage header - Add comprehensive tests for SyncStatusIndicator and SyncProvider - Update existing tests to include SyncProvider wrapper 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'src/client/sync/pull.test.ts')
-rw-r--r--src/client/sync/pull.test.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/client/sync/pull.test.ts b/src/client/sync/pull.test.ts
index 1aaac84..23c64ef 100644
--- a/src/client/sync/pull.test.ts
+++ b/src/client/sync/pull.test.ts
@@ -5,7 +5,7 @@ import "fake-indexeddb/auto";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { CardState, db, Rating } from "../db/index";
import { localCardRepository, localDeckRepository } from "../db/repositories";
-import { pullResultToLocalData, PullService } from "./pull";
+import { PullService, pullResultToLocalData } from "./pull";
import { SyncQueue } from "./queue";
describe("pullResultToLocalData", () => {
@@ -68,7 +68,9 @@ describe("pullResultToLocalData", () => {
currentSyncVersion: 3,
});
- expect(result.decks[0]?.deletedAt).toEqual(new Date("2024-01-03T12:00:00Z"));
+ expect(result.decks[0]?.deletedAt).toEqual(
+ new Date("2024-01-03T12:00:00Z"),
+ );
});
it("should convert server cards to local format", () => {
@@ -410,7 +412,9 @@ describe("PullService", () => {
});
it("should throw error if pull fails", async () => {
- const pullFromServer = vi.fn().mockRejectedValue(new Error("Network error"));
+ const pullFromServer = vi
+ .fn()
+ .mockRejectedValue(new Error("Network error"));
const pullService = new PullService({
syncQueue,