-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
labels_test.go
27 lines (22 loc) · 934 Bytes
/
labels_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package config
import (
_ "embed"
"testing"
"github.com/stretchr/testify/assert"
)
// Labels file is from: https://gitlab.com/gitlab-org/gitlab/-/raw/master/doc/api/labels.md
//
//go:embed testdata/labels.md
var testLabels []byte
func TestParseLabelsDocumentation(t *testing.T) {
t.Parallel()
data, errE := parseLabelsDocumentation(testLabels)
assert.NoError(t, errE, "% -+#.1v", errE)
assert.Equal(t, map[string]string{
"color": "The color of the label given in 6-digit hex notation with leading '#' sign (for example, #FFAABB) or one of the CSS color names. Type: string",
"description": "The description of the label. Type: string",
"id": "The ID or title of a group's label. Type: integer or string",
"name": "The name of the label. Type: string",
"priority": "The priority of the label. Must be greater or equal than zero or null to remove the priority. Type: integer",
}, data)
}