You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

issue_test.go 596B

123456789101112131415161718192021222324
  1. // Copyright 2020 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package convert
  5. import (
  6. "testing"
  7. "code.gitea.io/gitea/models"
  8. api "code.gitea.io/gitea/modules/structs"
  9. "github.com/stretchr/testify/assert"
  10. )
  11. func TestLabel_ToLabel(t *testing.T) {
  12. assert.NoError(t, models.PrepareTestDatabase())
  13. label := models.AssertExistsAndLoadBean(t, &models.Label{ID: 1}).(*models.Label)
  14. assert.Equal(t, &api.Label{
  15. ID: label.ID,
  16. Name: label.Name,
  17. Color: "abcdef",
  18. }, ToLabel(label))
  19. }