mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-21 16:40:52 +00:00
[API] Fix inconsistent label color format (#10129)
* update and use labelColorPattern * add TestCases * fix lint * # optional for templates * fix typo * some more * fix lint of **master**
This commit is contained in:
parent
74a4a1e17f
commit
e273817154
9 changed files with 170 additions and 54 deletions
|
@ -45,8 +45,11 @@ func TestNewLabels(t *testing.T) {
|
|||
assert.NoError(t, PrepareTestDatabase())
|
||||
labels := []*Label{
|
||||
{RepoID: 2, Name: "labelName2", Color: "#123456"},
|
||||
{RepoID: 3, Name: "labelName3", Color: "#234567"},
|
||||
{RepoID: 3, Name: "labelName3", Color: "#23456F"},
|
||||
}
|
||||
assert.Error(t, NewLabel(&Label{RepoID: 3, Name: "invalid Color", Color: ""}))
|
||||
assert.Error(t, NewLabel(&Label{RepoID: 3, Name: "invalid Color", Color: "123456"}))
|
||||
assert.Error(t, NewLabel(&Label{RepoID: 3, Name: "invalid Color", Color: "#12345G"}))
|
||||
for _, label := range labels {
|
||||
AssertNotExistsBean(t, label)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue