From bdf7e8b58e5fbcacaa2f790974256877ba6fac3b Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 5 Sep 2020 21:58:57 +0200 Subject: [PATCH] Fixed namespace tests --- pkg/models/namespace_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/models/namespace_test.go b/pkg/models/namespace_test.go index 5c99aa9eb..1c23cf729 100644 --- a/pkg/models/namespace_test.go +++ b/pkg/models/namespace_test.go @@ -143,8 +143,9 @@ func TestNamespace_ReadAll(t *testing.T) { namespaces := nn.([]*NamespaceWithLists) assert.NoError(t, err) assert.NotNil(t, namespaces) - assert.Len(t, namespaces, 9) // Total of 9 including shared - assert.Equal(t, int64(-1), namespaces[0].ID) // The first one should be the one with the shared namespaces + assert.Len(t, namespaces, 10) // Total of 10 including shared & favorites + assert.Equal(t, int64(-2), namespaces[0].ID) // The first one should be the one with favorites + assert.Equal(t, int64(-1), namespaces[1].ID) // The second one should be the one with the shared namespaces // Ensure every list and namespace are not archived for _, namespace := range namespaces { assert.False(t, namespace.IsArchived) @@ -161,7 +162,8 @@ func TestNamespace_ReadAll(t *testing.T) { namespaces := nn.([]*NamespaceWithLists) assert.NoError(t, err) assert.NotNil(t, namespaces) - assert.Len(t, namespaces, 10) // Total of 10 including shared, one is archived - assert.Equal(t, int64(-1), namespaces[0].ID) // The first one should be the one with the shared namespaces + assert.Len(t, namespaces, 11) // Total of 11 including shared & favorites, one is archived + assert.Equal(t, int64(-2), namespaces[0].ID) // The first one should be the one with favorites + assert.Equal(t, int64(-1), namespaces[1].ID) // The second one should be the one with the shared namespaces }) }