add statistics tests

This commit is contained in:
Hayden 2022-11-01 13:53:21 -08:00
parent f39a00bd85
commit 7e7812f3cc
No known key found for this signature in database
GPG key ID: 17CF79474E257545

View file

@ -31,3 +31,16 @@ func Test_Group_Update(t *testing.T) {
assert.Equal(t, "test2", g.Name) assert.Equal(t, "test2", g.Name)
assert.Equal(t, "EUR", g.Currency) assert.Equal(t, "EUR", g.Currency)
} }
func Test_Group_GroupStatistics(t *testing.T) {
useItems(t, 20)
useLabels(t, 20)
stats, err := tRepos.Groups.GroupStatistics(context.Background(), tGroup.ID)
assert.NoError(t, err)
assert.Equal(t, 20, stats.TotalItems)
assert.Equal(t, 20, stats.TotalLabels)
assert.Equal(t, 1, stats.TotalUsers)
assert.Equal(t, 1, stats.TotalLocations)
}