From c5ebffb57b4df40541d4208769130f23ce2a1b83 Mon Sep 17 00:00:00 2001 From: Jakub Chrobasik Date: Wed, 13 Apr 2022 19:08:46 +0200 Subject: [PATCH] test: test proving the bug on delete.top on a property with array --- src/test/scala/io/renku/jsonld/CursorSpec.scala | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/test/scala/io/renku/jsonld/CursorSpec.scala b/src/test/scala/io/renku/jsonld/CursorSpec.scala index da30146..11b92e8 100644 --- a/src/test/scala/io/renku/jsonld/CursorSpec.scala +++ b/src/test/scala/io/renku/jsonld/CursorSpec.scala @@ -227,6 +227,17 @@ class CursorSpec extends AnyWordSpec with ScalaCheckPropertyChecks with should.M } } + "allow to remove a selected field if its value is an Array" in new TestCase { + forAll { (id: EntityId, entityTypes: EntityTypes, property1: Property, property2: (Property, JsonLD)) => + JsonLD + .entity(id, entityTypes, property1 -> JsonLD.arr(jsonLDValues.generateOne), property2) + .cursor + .downField(property1) + .delete + .top shouldBe Some(JsonLD.entity(id, entityTypes, property2)) + } + } + "allow to remove a selected entity" in new TestCase { forAll { (id: EntityId, entityTypes: EntityTypes, property: (Property, JsonLD)) => JsonLD