Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
damontecres committed Aug 29, 2024
1 parent e70e586 commit 072f09a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ class FrontPageFilterTests {
} doReturn listOf<PerformerData>()
}
val frontPageParser =
FrontPageParser(mockedContext, mockedQueryEngine, FilterParser(Version.V0_25_0))
FrontPageParser(
mockedContext,
mockedQueryEngine,
FilterParser(Version.MINIMUM_STASH_VERSION),
)
val result =
runBlocking { frontPageParser.parse(parseFileToFrontPageContent("front_page_basic.json")) }
val rows = result.map { runBlocking { it.await() } }
Expand All @@ -106,7 +110,11 @@ class FrontPageFilterTests {
fun unsupportedTest() {
val mockedQueryEngine = mock<QueryEngine>()
val frontPageParser =
FrontPageParser(mockedContext, mockedQueryEngine, FilterParser(Version.V0_25_0))
FrontPageParser(
mockedContext,
mockedQueryEngine,
FilterParser(Version.MINIMUM_STASH_VERSION),
)
val result = runBlocking { frontPageParser.parse(parseFileToFrontPageContent("front_page_unsupported.json")) }
val rows = result.map { runBlocking { it.await() } }
Assert.assertEquals(2, rows.size)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class ObjectFilterParsingTests {
fun testSceneFilter() {
val savedFilterData = getSavedFilterData("scene_savedfilter.json")
val sceneFilter =
FilterParser(Version.V0_25_0).convertSceneObjectFilter(savedFilterData.object_filter)
FilterParser(Version.MINIMUM_STASH_VERSION).convertSceneObjectFilter(savedFilterData.object_filter)
Assert.assertNotNull(sceneFilter!!)
Assert.assertEquals(FilterMode.SCENES, savedFilterData.mode)
Assert.assertEquals(
Expand Down Expand Up @@ -125,7 +125,7 @@ class ObjectFilterParsingTests {
fun testPerformerFilter() {
val savedFilterData = getSavedFilterData("performer_savedfilter.json")
val performerFilter =
FilterParser(Version.V0_25_0).convertPerformerObjectFilter(savedFilterData.object_filter)
FilterParser(Version.MINIMUM_STASH_VERSION).convertPerformerObjectFilter(savedFilterData.object_filter)
Assert.assertNotNull(performerFilter!!)
Assert.assertEquals(FilterMode.PERFORMERS, savedFilterData.mode)

Expand All @@ -147,7 +147,7 @@ class ObjectFilterParsingTests {
fun testGenderFilter() {
val savedFilterData = getSavedFilterData("gender_savedfilter.json")
val performerFilter =
FilterParser(Version.V0_25_0).convertPerformerObjectFilter(savedFilterData.object_filter)
FilterParser(Version.MINIMUM_STASH_VERSION).convertPerformerObjectFilter(savedFilterData.object_filter)
Assert.assertNotNull(performerFilter!!)
Assert.assertEquals(FilterMode.PERFORMERS, savedFilterData.mode)

Expand All @@ -167,7 +167,7 @@ class ObjectFilterParsingTests {
fun testStudioChildrenFilter() {
val savedFilterData = getSavedFilterData("studio_children_savedfilter.json")
val studioFilter =
FilterParser(Version.V0_25_0).convertStudioObjectFilter(savedFilterData.object_filter)
FilterParser(Version.MINIMUM_STASH_VERSION).convertStudioObjectFilter(savedFilterData.object_filter)
Assert.assertNotNull(studioFilter!!)
Assert.assertEquals(FilterMode.STUDIOS, savedFilterData.mode)

Expand Down

0 comments on commit 072f09a

Please sign in to comment.