aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/client/components/EditNoteTypeModal.test.tsx
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-12-31 02:49:55 +0900
committernsfisis <nsfisis@gmail.com>2025-12-31 02:49:55 +0900
commit6aa496b60879526b51fdf736c38f09aede283bde (patch)
treeeaeb4bc61ae10cd81f76e48047ad5f2193a53c38 /src/client/components/EditNoteTypeModal.test.tsx
parentb51d4efaa1e5e0417d4306c02797f424938766cb (diff)
downloadkioku-6aa496b60879526b51fdf736c38f09aede283bde.tar.gz
kioku-6aa496b60879526b51fdf736c38f09aede283bde.tar.zst
kioku-6aa496b60879526b51fdf736c38f09aede283bde.zip
feat(client): add NoteTypeEditor component with field management
Add a comprehensive editor for note types that allows users to: - Edit note type name and templates - Add, remove, and reorder fields - Toggle the reversible card option The editor fetches note type details including fields from the API, enabling full CRUD operations for note type configuration. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'src/client/components/EditNoteTypeModal.test.tsx')
-rw-r--r--src/client/components/EditNoteTypeModal.test.tsx27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/client/components/EditNoteTypeModal.test.tsx b/src/client/components/EditNoteTypeModal.test.tsx
index c8064bd..61130e2 100644
--- a/src/client/components/EditNoteTypeModal.test.tsx
+++ b/src/client/components/EditNoteTypeModal.test.tsx
@@ -185,22 +185,19 @@ describe("EditNoteTypeModal", () => {
await user.click(screen.getByRole("button", { name: "Save Changes" }));
await waitFor(() => {
- expect(mockFetch).toHaveBeenCalledWith(
- "/api/note-types/note-type-123",
- {
- method: "PUT",
- headers: {
- "Content-Type": "application/json",
- Authorization: "Bearer access-token",
- },
- body: JSON.stringify({
- name: "Updated Basic",
- frontTemplate: "{{Front}}",
- backTemplate: "{{Back}}",
- isReversible: true,
- }),
+ expect(mockFetch).toHaveBeenCalledWith("/api/note-types/note-type-123", {
+ method: "PUT",
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: "Bearer access-token",
},
- );
+ body: JSON.stringify({
+ name: "Updated Basic",
+ frontTemplate: "{{Front}}",
+ backTemplate: "{{Back}}",
+ isReversible: true,
+ }),
+ });
});
expect(onNoteTypeUpdated).toHaveBeenCalledTimes(1);