aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/client/db/repositories.test.ts
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-25 23:02:35 +0900
committernsfisis <nsfisis@gmail.com>2026-02-25 23:02:35 +0900
commit38b8fc0e9927c4146b4c8b309b2bcc644abd63d0 (patch)
treef76ba23251645e552fccd201362064b06de50bdd /src/client/db/repositories.test.ts
parent7a77e72bb49ed3990a0c4581292a37a8a4f35231 (diff)
downloadkioku-38b8fc0e9927c4146b4c8b309b2bcc644abd63d0.tar.gz
kioku-38b8fc0e9927c4146b4c8b309b2bcc644abd63d0.tar.zst
kioku-38b8fc0e9927c4146b4c8b309b2bcc644abd63d0.zip
feat(decks): add default note type setting per deckHEADmain
Allow each deck to specify a default note type that is auto-selected when creating new notes. Includes DB schema migration, server API updates, sync layer support, and UI for editing the default in the deck settings modal. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'src/client/db/repositories.test.ts')
-rw-r--r--src/client/db/repositories.test.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/client/db/repositories.test.ts b/src/client/db/repositories.test.ts
index b461990..6a77760 100644
--- a/src/client/db/repositories.test.ts
+++ b/src/client/db/repositories.test.ts
@@ -33,6 +33,7 @@ describe("localDeckRepository", () => {
userId: "user-1",
name: "Test Deck",
description: "A test deck",
+ defaultNoteTypeId: null,
});
expect(deck.id).toBeDefined();
@@ -51,6 +52,7 @@ describe("localDeckRepository", () => {
userId: "user-1",
name: "Test Deck",
description: null,
+ defaultNoteTypeId: null,
});
const found = await db.decks.get(created.id);
@@ -64,6 +66,7 @@ describe("localDeckRepository", () => {
userId: "user-1",
name: "Test Deck",
description: null,
+ defaultNoteTypeId: null,
});
const found = await localDeckRepository.findById(created.id);
@@ -82,16 +85,19 @@ describe("localDeckRepository", () => {
userId: "user-1",
name: "Deck 1",
description: null,
+ defaultNoteTypeId: null,
});
await localDeckRepository.create({
userId: "user-1",
name: "Deck 2",
description: null,
+ defaultNoteTypeId: null,
});
await localDeckRepository.create({
userId: "user-2",
name: "Other User Deck",
description: null,
+ defaultNoteTypeId: null,
});
const decks = await localDeckRepository.findByUserId("user-1");
@@ -104,6 +110,7 @@ describe("localDeckRepository", () => {
userId: "user-1",
name: "Deleted Deck",
description: null,
+ defaultNoteTypeId: null,
});
await localDeckRepository.delete(deck.id);
@@ -118,6 +125,7 @@ describe("localDeckRepository", () => {
userId: "user-1",
name: "Original Name",
description: null,
+ defaultNoteTypeId: null,
});
const updated = await localDeckRepository.update(deck.id, {
@@ -147,6 +155,7 @@ describe("localDeckRepository", () => {
userId: "user-1",
name: "Test Deck",
description: null,
+ defaultNoteTypeId: null,
});
const result = await localDeckRepository.delete(deck.id);
@@ -169,11 +178,13 @@ describe("localDeckRepository", () => {
userId: "user-1",
name: "Unsynced",
description: null,
+ defaultNoteTypeId: null,
});
const deck2 = await localDeckRepository.create({
userId: "user-1",
name: "Synced",
description: null,
+ defaultNoteTypeId: null,
});
await localDeckRepository.markSynced(deck2.id, 1);
@@ -189,6 +200,7 @@ describe("localDeckRepository", () => {
userId: "user-1",
name: "Test",
description: null,
+ defaultNoteTypeId: null,
});
await localDeckRepository.markSynced(deck.id, 5);
@@ -212,6 +224,7 @@ describe("localCardRepository", () => {
userId: "user-1",
name: "Test Deck",
description: null,
+ defaultNoteTypeId: null,
});
deckId = deck.id;
});
@@ -411,6 +424,7 @@ describe("localReviewLogRepository", () => {
userId: "user-1",
name: "Test Deck",
description: null,
+ defaultNoteTypeId: null,
});
deckId = deck.id;
@@ -935,6 +949,7 @@ describe("localNoteRepository", () => {
userId: "user-1",
name: "Test Deck",
description: null,
+ defaultNoteTypeId: null,
});
deckId = deck.id;
@@ -1094,6 +1109,7 @@ describe("localNoteFieldValueRepository", () => {
userId: "user-1",
name: "Test Deck",
description: null,
+ defaultNoteTypeId: null,
});
const noteType = await localNoteTypeRepository.create({