mirror of
https://github.com/hay-kot/homebox.git
synced 2025-08-04 08:40:28 +00:00
fix tests
This commit is contained in:
parent
47e8f553ff
commit
672923d58e
3 changed files with 6 additions and 13 deletions
|
@ -27,7 +27,7 @@ func (Group) Fields() []ent.Field {
|
||||||
NotEmpty(),
|
NotEmpty(),
|
||||||
field.Enum("currency").
|
field.Enum("currency").
|
||||||
Default("usd").
|
Default("usd").
|
||||||
Values("usd", "eur", "gbp", "jpy", "zar", "aud", "nok", "sek", "dkk", "inr", "rmb"),
|
Values("usd", "eur", "gbp", "jpy", "zar", "aud", "nok", "sek", "dkk", "inr", "rmb", "bgn"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -176,9 +176,7 @@ func (r *LocationRepository) Create(ctx context.Context, GID uuid.UUID, data Loc
|
||||||
SetDescription(data.Description).
|
SetDescription(data.Description).
|
||||||
SetGroupID(GID)
|
SetGroupID(GID)
|
||||||
|
|
||||||
println(data.ParentID.String())
|
|
||||||
if data.ParentID != uuid.Nil {
|
if data.ParentID != uuid.Nil {
|
||||||
println("SET PARENT")
|
|
||||||
q.SetParentID(data.ParentID)
|
q.SetParentID(data.ParentID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -138,18 +138,13 @@ func TestItemRepository_TreeQuery(t *testing.T) {
|
||||||
|
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
assert.Equal(t, 3, len(locations))
|
assert.Equal(t, 2, len(locations))
|
||||||
|
|
||||||
for _, loc := range locs {
|
// Check roots
|
||||||
found := false
|
for _, loc := range locations {
|
||||||
|
if loc.ID == locs[1].ID {
|
||||||
for _, l := range locations {
|
assert.Equal(t, 1, len(loc.Children))
|
||||||
if l.ID == loc.ID {
|
|
||||||
found = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.True(t, found)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue