Add unit tests for Checklists
Create checklists_test.go with comprehensive tests: - TestChecklists_List: list all checklists - TestChecklists_ListArchived: list with archived filter - TestChecklists_Get: get single checklist by ID - TestChecklists_Get_NotFound: handle 404 error - TestChecklists_Create: create new checklist - TestChecklists_Update: update checklist name - TestChecklists_Delete: delete checklist Add testdata/checklists/ fixtures: - list.json: sample checklist list - list_archived.json: archived checklists - single.json: single checklist response All 7 tests pass using httptest.Server mocking. Closes checkvist-api-347
This commit is contained in:
parent
5f71f40077
commit
0bb7d2d735
5 changed files with 309 additions and 1 deletions
24
testdata/checklists/list.json
vendored
Normal file
24
testdata/checklists/list.json
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
[
|
||||
{
|
||||
"id": 1,
|
||||
"name": "My First Checklist",
|
||||
"public": false,
|
||||
"archived": false,
|
||||
"read_only": false,
|
||||
"task_count": 10,
|
||||
"task_completed": 3,
|
||||
"tags_as_text": "",
|
||||
"updated_at": "2026-01-14T10:00:00Z"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"name": "Work Tasks",
|
||||
"public": true,
|
||||
"archived": false,
|
||||
"read_only": false,
|
||||
"task_count": 25,
|
||||
"task_completed": 12,
|
||||
"tags_as_text": "work, important",
|
||||
"updated_at": "2026-01-13T15:30:00Z"
|
||||
}
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue