Skip to content

Added Forgot Password Unit Test #2723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions app/src/androidTest/java/fr/free/nrw/commons/LoginActivityTest.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package fr.free.nrw.commons

import android.content.Intent
import androidx.test.espresso.Espresso
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.assertion.ViewAssertions
import androidx.test.espresso.intent.Intents
import androidx.test.espresso.intent.Intents.intended
import androidx.test.espresso.intent.matcher.IntentMatchers.hasAction
import androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.espresso.matcher.ViewMatchers.withId
Expand Down Expand Up @@ -33,4 +35,15 @@ class LoginActivityTest {
intended(hasComponent(SignupActivity::class.java.name))
Intents.release()
}

@Test
fun isForgotPasswordWorks() {
// Clicks the forgot password
Intents.init()
Espresso.onView(withId(R.id.forgotPassword))
.check(ViewAssertions.matches(ViewMatchers.isDisplayed()))
.perform(click())
intended(hasAction(Intent.ACTION_VIEW))
Intents.release()
}
}