Skip to content

Commit

Permalink
feat: tags collection redesign
Browse files Browse the repository at this point in the history
  • Loading branch information
haller33 committed Dec 11, 2024
1 parent 8e52777 commit f6b5f3e
Show file tree
Hide file tree
Showing 21 changed files with 1,262 additions and 141 deletions.
14 changes: 13 additions & 1 deletion api/routes/tags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"github.com/shellhub-io/shellhub/api/services/mocks"
"github.com/shellhub-io/shellhub/pkg/api/authorizer"
"github.com/shellhub-io/shellhub/pkg/models"
"github.com/stretchr/testify/assert"
gomock "github.com/stretchr/testify/mock"
)
Expand All @@ -26,7 +27,18 @@ func TestGetTags(t *testing.T) {
title: "success when try to get an existing tag",
expectedStatus: http.StatusOK,
requiredMocks: func() {
mock.On("GetTags", gomock.Anything, "").Return([]string{"tag1", "tag2"}, 2, nil)
mock.On("GetTags", gomock.Anything, "").Return([]models.Tags{
{
Name: "tag-1",
Color: "#ff0000",
Tenant: "00000000-0000-4000-0000-000000000000",
},
{
Name: "tag-2",
Color: "green",
Tenant: "00000000-0000-4000-0000-000000000000",
},
}, 2, nil)
},
},
}
Expand Down
Loading

0 comments on commit f6b5f3e

Please sign in to comment.