summaryrefslogtreecommitdiff
path: root/internal/handlers/widget_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/handlers/widget_test.go')
-rw-r--r--internal/handlers/widget_test.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/internal/handlers/widget_test.go b/internal/handlers/widget_test.go
index 2bb92bc..fcbba52 100644
--- a/internal/handlers/widget_test.go
+++ b/internal/handlers/widget_test.go
@@ -17,6 +17,7 @@ import (
type mockGoogleTasksClient struct {
completedListID, completedTaskID string
notesListID, notesTaskID, notes string
+ notesTitle string
}
func (m *mockGoogleTasksClient) GetTasks(ctx context.Context) ([]models.GoogleTask, error) {
@@ -32,8 +33,8 @@ func (m *mockGoogleTasksClient) CompleteTask(ctx context.Context, listID, taskID
func (m *mockGoogleTasksClient) UncompleteTask(ctx context.Context, listID, taskID string) error {
return nil
}
-func (m *mockGoogleTasksClient) UpdateTaskNotes(ctx context.Context, listID, taskID, notes string) error {
- m.notesListID, m.notesTaskID, m.notes = listID, taskID, notes
+func (m *mockGoogleTasksClient) UpdateTask(ctx context.Context, listID, taskID, title, notes string) error {
+ m.notesListID, m.notesTaskID, m.notesTitle, m.notes = listID, taskID, title, notes
return nil
}
func (m *mockGoogleTasksClient) GetTaskLists(ctx context.Context) ([]models.TaskListInfo, error) {
@@ -678,6 +679,9 @@ func TestHandleWidgetUpdate_GoogleTask(t *testing.T) {
if mock.notesListID != "list-a" || mock.notesTaskID != "g1" || mock.notes != "bring photo and $170" {
t.Errorf("unexpected update call: listID=%q taskID=%q notes=%q", mock.notesListID, mock.notesTaskID, mock.notes)
}
+ if mock.notesTitle != "Renew passport" {
+ t.Errorf("title = %q, want unchanged %q (widget's edit popup has no title field)", mock.notesTitle, "Renew passport")
+ }
}
func seedTestCard(t *testing.T, db *store.Store) {