Skip to content

Commit

Permalink
[#19] Fix lint and test
Browse files Browse the repository at this point in the history
  • Loading branch information
blyscuit committed Jan 5, 2023
1 parent 80d7813 commit 7e8640e
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 6 deletions.
7 changes: 6 additions & 1 deletion iosApp/SurveyKIFUITests/Sources/Screens/LoginScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
final class LoginScreen: GenericScreen {

func loginIfNeeded() {
tester.waitForAbsenceOfView(withAccessibilityIdentifier: ViewId.splash(.view)())
if tester.tryFindingView(withAccessibilityIdentifier: ViewId.surveySelection(.view)()) {
return
}
if tester.tryFindingView(withAccessibilityIdentifier: ViewId.splash(.view)()) {
tester.waitForAbsenceOfView(withAccessibilityIdentifier: ViewId.splash(.view)())
}
if tester.tryFindingView(withAccessibilityIdentifier: ViewId.login(.view)()) {
tester.waitForTappableView(withAccessibilityIdentifier: ViewId.login(.loginButton)())
tester.tapView(withAccessibilityIdentifier: ViewId.login(.loginButton)())
Expand Down
5 changes: 5 additions & 0 deletions iosApp/SurveyKIFUITests/Sources/Screens/SurveyScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@

final class SurveyScreen: GenericScreen {

func waitForAppearance() {
tester.waitForView(withAccessibilityIdentifier: ViewId.surveySelection(.view)())
}

func navigateToAccount() {
waitForAppearance()
tester.tapView(withAccessibilityIdentifier: ViewId.surveySelection(.headerProfileImage)())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class SurveySelectionSpec: QuickSpec {

beforeEach {
loginScreen.loginIfNeeded()
surveyScreen.navigateToAccount()
surveyScreen.waitForAppearance()
}

describe("its image area") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ final class SurveySelectionViewDataSourceSpec: QuickSpec {
describe("its checkFetchMore") {

beforeEach {
try? self.awaitPublisher(dataSource.$surveys.collectNext(2))
_ = try? self.awaitPublisher(dataSource.$surveys.collectNext(2))
delayCheckFetchMore()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ class DataStoreImpl(private val settings: Settings): DataStore {
settings
.keys
.filter { it.startsWith(key) }
.map { settings.removeObject(it) }
.map { settings.remove(it) }
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@file:Suppress("MagicNumber")
package co.nimblehq.blisskmmic.presentation.modules.surveyselection

import app.cash.turbine.test
Expand Down Expand Up @@ -210,7 +211,7 @@ class SurveySelectionViewModelTest : TestsWithMocks() {
fun `When calling checkFetchMore fetch correct index - it changes viewState with correct item`() = runTest {
mocker.every {
getCurrentDateUseCase()
} returns delayFlowOf(dateComponent)
} returns delayFlowOf(TIME)
mocker.every {
getProfileUseCase()
} returns flowOf(user)
Expand Down Expand Up @@ -240,7 +241,7 @@ class SurveySelectionViewModelTest : TestsWithMocks() {
fun `When calling checkFetchMore fetch incompleted index - it does not fetch more`() = runTest {
mocker.every {
getCurrentDateUseCase()
} returns delayFlowOf(dateComponent)
} returns delayFlowOf(TIME)
mocker.every {
getProfileUseCase()
} returns flowOf(user)
Expand Down

0 comments on commit 7e8640e

Please sign in to comment.