mirror of
https://github.com/hay-kot/homebox.git
synced 2025-06-27 06:08:36 +00:00
feat: group statistics endpoint (#123)
* group statistics endpoint * remove item store * return possible errors * add statistics tests
This commit is contained in:
parent
a886fa86ca
commit
7e0f1fac23
13 changed files with 201 additions and 74 deletions
|
@ -31,3 +31,16 @@ func Test_Group_Update(t *testing.T) {
|
|||
assert.Equal(t, "test2", g.Name)
|
||||
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