mirror of
https://github.com/hay-kot/homebox.git
synced 2025-08-04 00:30:27 +00:00
add statistics tests
This commit is contained in:
parent
f39a00bd85
commit
7e7812f3cc
1 changed files with 13 additions and 0 deletions
|
@ -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)
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue