Skip to content

Commit

Permalink
fix tests (createdBy must exist)
Browse files Browse the repository at this point in the history
  • Loading branch information
eikek committed Oct 25, 2024
1 parent edc641e commit 381cff3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SearchApiSpec extends CatsEffectSuite with SearchSolrSuite:
val project1 = projectDocumentGen(
"matching",
"matching description",
Gen.const(None),
userDocumentGen.asOption,
Gen.const(None),
Gen.const(Visibility.Public)
).generateOne
Expand Down Expand Up @@ -76,7 +76,7 @@ class SearchApiSpec extends CatsEffectSuite with SearchSolrSuite:
val project = projectDocumentGen(
"exclusive",
"exclusive description",
Gen.const(None),
userDocumentGen.asOption,
Gen.const(None),
Gen.const(Visibility.Public)
).generateOne.copy(createdBy = userId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,29 @@ class SearchSolrClientSpec extends CatsEffectSuite with SearchSolrSuite:
override def munitFixtures: Seq[munit.AnyFixture[?]] =
List(solrServer, searchSolrClient)

test("ignore entities with non-existing namespace"):
val user = userDocumentGen.generateOne
val group = groupDocumentGen.generateOne
val project0 = projectDocumentGen(
"project-test0",
"project-test0 description",
Gen.const(None),
Gen.const(None)
).generateOne.copy(createdBy = user.id, namespace = group.namespace.some)
val project1 = projectDocumentGen(
"project-test1",
"project-test1 description",
Gen.const(None),
Gen.const(None)
).generateOne.copy(createdBy = user.id, namespace = group.namespace.some)

for
client <- IO(searchSolrClient())
_ <- IO.println(client)
_ <- IO.println(project0)
_ <- IO.println(project1)
yield ()

test("load project with resolved namespace and creator"):
val user = userDocumentGen.generateOne
val group = groupDocumentGen.generateOne
Expand Down

0 comments on commit 381cff3

Please sign in to comment.