Skip to content

Commit 6e548f2

Browse files
committed
Add test for UpdateSourceDisplayName
1 parent 58d48dc commit 6e548f2

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

internal/store/store_test.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,25 @@ func TestStore_Source_UpdateSyncCursor(t *testing.T) {
7575
}
7676
}
7777

78+
func TestStore_Source_UpdateDisplayName(t *testing.T) {
79+
st, source, _ := setupStore(t)
80+
81+
err := st.UpdateSourceDisplayName(source.ID, "Work Account")
82+
if err != nil {
83+
t.Fatalf("UpdateSourceDisplayName() error = %v", err)
84+
}
85+
86+
// Verify display name was updated
87+
updated, err := st.GetSourceByIdentifier("test@example.com")
88+
if err != nil {
89+
t.Fatalf("GetSourceByIdentifier() error = %v", err)
90+
}
91+
92+
if !updated.DisplayName.Valid || updated.DisplayName.String != "Work Account" {
93+
t.Errorf("DisplayName = %v, want 'Work Account'", updated.DisplayName)
94+
}
95+
}
96+
7897
func TestStore_Conversation(t *testing.T) {
7998
f := storetest.New(t)
8099

0 commit comments

Comments
 (0)