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 10, 2024
1 parent 8e52777 commit dc766ed
Show file tree
Hide file tree
Showing 21 changed files with 1,299 additions and 130 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 dc766ed

Please sign in to comment.