Skip to content

Commit

Permalink
Add test for applying label changes (#349)
Browse files Browse the repository at this point in the history
* add test

* add test
  • Loading branch information
KirilKabakchiev authored Nov 11, 2019
1 parent 34d3c9c commit 7c1612c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions pkg/query/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,32 @@ var _ = Describe("Update", func() {
},
ExpectedLabelsToAdd: types.Labels{},
}),
Entry("remove two consecutive values removes both of them",
testEntry{
InitialLabels: types.Labels{
"organization_guid": {
"org0", "org1", "org2", "org4",
},
},
Changes: LabelChanges{
&LabelChange{
Operation: RemoveLabelValuesOperation,
Key: "organization_guid",
Values: []string{"org1", "org2"},
},
},
ExpectedMergedLabels: types.Labels{
"organization_guid": {
"org0", "org4",
},
},
ExpectedLabelsToRemove: types.Labels{
"organization_guid": {
"org1", "org2",
},
},
ExpectedLabelsToAdd: types.Labels{},
}),
}

DescribeTable("", func(t testEntry) {
Expand Down

0 comments on commit 7c1612c

Please sign in to comment.