add test for updating non-existent labels

pull/10616/head
Jade McGough 2018-12-18 00:33:32 -08:00
parent 5036777750
commit 1f08f74cce
1 changed files with 22 additions and 0 deletions

View File

@ -352,6 +352,28 @@ func UpdateLabel(
},
},
},
{
name: "updating a non-existent label",
fields: LabelFields{
Labels: []*platform.Label{},
},
args: args{
label: platform.Label{
ResourceID: MustIDBase16(bucketOneID),
Name: "Tag1",
},
update: platform.LabelUpdate{
Color: &validColor,
},
},
wants: wants{
labels: []*platform.Label{},
err: &platform.Error{
Code: platform.ENotFound,
Op: platform.OpUpdateLabel,
},
},
},
}
for _, tt := range tests {