Skip to content

Commit

Permalink
[#35] Add survey quit test
Browse files Browse the repository at this point in the history
  • Loading branch information
blyscuit committed Feb 7, 2023
1 parent 642d98d commit 2ad7bc7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,12 @@ final class SurveyQuestionScreen: GenericScreen {
func tapCloseButton() {
tester().tapView(withAccessibilityIdentifier: ViewId.surveyQuestion(.closeButton)())
}

func tapConfirmCloseDialog() {
tester().tapView(withAccessibilityLabel: "Yes")
}

func tapCancelCloseDialog() {
tester().tapView(withAccessibilityLabel: "Cancel")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ final class SurveyQuestionSpec: QuickSpec {

afterEach {
surveyQuestionScreen.tapCloseButton()
surveyQuestionScreen.tapConfirmCloseDialog()
surveyScreen.waitForAppearance()
}

Expand All @@ -58,6 +59,21 @@ final class SurveyQuestionSpec: QuickSpec {
withAccessibilityIdentifier: ViewId.surveyQuestion(.nextButton)()
)
}

describe("its close button") {

context("when tapped and tap cancel") {

beforeEach {
surveyQuestionScreen.tapCloseButton()
surveyQuestionScreen.tapCancelCloseDialog()
}

it("shows surveyQuestion screen") {
surveyQuestionScreen.waitForAppearance()
}
}
}
}
}
}
Expand Down

0 comments on commit 2ad7bc7

Please sign in to comment.