diff --git a/pkg/query/update_test.go b/pkg/query/update_test.go index 49b52e1f4..56f4b4da1 100644 --- a/pkg/query/update_test.go +++ b/pkg/query/update_test.go @@ -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) {