Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnarvelle committed Nov 28, 2024
1 parent 4aede8d commit ece75f2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

package no.ndla.searchapi.service.search

import com.sksamuel.elastic4s.ElasticDsl._
import com.sksamuel.elastic4s.ElasticDsl.*
import no.ndla.scalatestsuite.IntegrationSuite
import no.ndla.searchapi.TestEnvironment

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import no.ndla.scalatestsuite.IntegrationSuite
import no.ndla.searchapi.TestData.*
import no.ndla.searchapi.model.api.MetaImage
import no.ndla.searchapi.model.domain.{IndexingBundle, LearningResourceType, Sort}
import no.ndla.searchapi.model.search.SearchTrait
import no.ndla.searchapi.{TestData, TestEnvironment, UnitSuite}

import scala.util.Success
Expand Down Expand Up @@ -708,7 +709,7 @@ class MultiSearchServiceTest
multiSearchService.matchingQuery(searchSettings.copy(query = Some(NonEmptyString.fromString("Ekstrastoff").get)))
search.totalCount should be(1)
search.results.head.id should be(12)
search.results.head.traits should be(List("H5P"))
search.results.head.traits should be(List(SearchTrait.H5p))
}

test("That searches for embed attributes matches") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import no.ndla.search.model.{LanguageValue, SearchableLanguageList, SearchableLa
import no.ndla.searchapi.caching.Memoize
import no.ndla.searchapi.model.domain.IndexingBundle
import no.ndla.searchapi.model.grep.{GrepElement, GrepTitle}
import no.ndla.searchapi.model.search.{SearchableArticle, SearchableGrepContext}
import no.ndla.searchapi.model.search.{SearchTrait, SearchableArticle, SearchableGrepContext}
import no.ndla.searchapi.model.taxonomy.*
import no.ndla.searchapi.{TestData, TestEnvironment, UnitSuite}
import org.mockito.ArgumentMatchers.any
Expand Down Expand Up @@ -538,7 +538,7 @@ class SearchConverterServiceTest extends UnitSuite with TestEnvironment {
article,
IndexingBundle(Some(TestData.emptyGrepBundle), Some(emptyBundle), None)
)
searchableArticle.traits should equal(List("H5P"))
searchableArticle.traits should equal(List(SearchTrait.H5p, SearchTrait.File))

val article2 =
TestData.emptyDomainArticle.copy(
Expand All @@ -561,7 +561,7 @@ class SearchConverterServiceTest extends UnitSuite with TestEnvironment {
article2,
IndexingBundle(Some(TestData.emptyGrepBundle), Some(emptyBundle), None)
)
searchableArticle2.traits should equal(List("H5P", "VIDEO"))
searchableArticle2.traits should equal(List(SearchTrait.H5p, SearchTrait.Video))
}

test("That extracting attributes extracts data-title but not all attributes") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SearchServiceTest extends UnitSuite with TestEnvironment {

val service: SearchService = new SearchService {
override val searchIndex = List(SearchType.Drafts, SearchType.LearningPaths).map(props.SearchIndex)
override val indexServices: List[IndexService[_]] = List(draftIndexService, learningPathIndexService)
override val indexServices: List[IndexService[?]] = List(draftIndexService, learningPathIndexService)
override protected def scheduleIndexDocuments(): Unit = {}
}

Expand Down

0 comments on commit ece75f2

Please sign in to comment.