Skip to content

Commit bb2051b

Browse files
committed
Fix gofmt and add test for ListSources
1 parent 47811bc commit bb2051b

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

cmd/msgvault/cmd/addaccount.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
)
1010

1111
var (
12-
headless bool
13-
accountDisplayName string
12+
headless bool
13+
accountDisplayName string
1414
)
1515

1616
var addAccountCmd = &cobra.Command{

internal/store/store_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,23 @@ func TestStore_Source_UpdateDisplayName(t *testing.T) {
9090
}
9191
}
9292

93+
func TestStore_ListSources(t *testing.T) {
94+
f := storetest.New(t)
95+
96+
sources, err := f.Store.ListSources()
97+
testutil.MustNoErr(t, err, "ListSources()")
98+
99+
if len(sources) != 1 {
100+
t.Fatalf("len(sources) = %d, want 1", len(sources))
101+
}
102+
if sources[0].Identifier != "test@example.com" {
103+
t.Errorf("Identifier = %q, want %q", sources[0].Identifier, "test@example.com")
104+
}
105+
if sources[0].ID != f.Source.ID {
106+
t.Errorf("ID = %d, want %d", sources[0].ID, f.Source.ID)
107+
}
108+
}
109+
93110
func TestStore_Conversation(t *testing.T) {
94111
f := storetest.New(t)
95112

0 commit comments

Comments
 (0)