Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: test proving the bug on delete.top on a property with array #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/test/scala/io/renku/jsonld/CursorSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down