This repository has been archived by the owner on Jan 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into maximezmt/testcoverage
- Loading branch information
Showing
7 changed files
with
134 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,9 +85,11 @@ class ProfileActivityTest { | |
every { mockUsersRepo.setFieldValue(any(), any(), any()) } answers {} | ||
} | ||
|
||
val mockImageURI = Uri.parse("https://raw.githubusercontent.com/Ashwinvalento/cartoon-avatar/master/lib/images/male/45.png") | ||
// val mockImageURI = Uri.parse("https://raw.githubusercontent.com/Ashwinvalento/cartoon-avatar/master/lib/images/male/45.png") | ||
private fun createMockImageGetter() { | ||
every {mockImageGetter.fetchImage(any(), any())} answers {} | ||
every {mockImageGetter.fetchImage(any(), any())} answers { | ||
// secondArg<(Uri) -> Unit>().invoke(mockImageURI) | ||
} | ||
} | ||
|
||
|
||
|
@@ -231,6 +233,28 @@ class ProfileActivityTest { | |
onView(withId(R.id.username)).check(matches(withText("Lalisa Bon"))) | ||
} | ||
|
||
// @Test | ||
// fun checkChangePhotoCancel() { | ||
// val inputProfile = User( "Lalisa Bon","bit.ly/3IUnyAF", "[email protected]", 12, 8, "VvPB47tQCLdjz3YebilS6h5EXdJ3") | ||
// val ctx = ApplicationProvider.getApplicationContext() as Context | ||
// val intent = Intent(ctx, ProfileActivity::class.java) | ||
// | ||
// createMockDataGetter(inputProfile) | ||
// createMockAuthenticator() | ||
// createMockImageGetter() | ||
// | ||
// val scn: ActivityScenario<ProfileActivity> = ActivityScenario.launch(intent) | ||
// | ||
// //TODO: potentially refactor this test to not need Thread.sleep | ||
// //This thread sleep is added for the mock image to load, might be a better way to test it but for now I'll leave it like that | ||
// Thread.sleep(3000) | ||
// | ||
// onView(withId(R.id.avatar)).perform(click()) | ||
// onView(withText("No")).perform(click()) | ||
// | ||
// onView(withId(R.id.avatar)).check(matches(isDisplayed())) | ||
// } | ||
|
||
@Test | ||
fun checkQrCodeGenerator() { | ||
val inputProfile = User( "Lalisa Bon", R.string.test_profile_image.toString(), "[email protected]", 12, 8,"VvPB47tQCLdjz3YebilS6h5EXdJ3") | ||
|
@@ -263,4 +287,3 @@ class ProfileActivityTest { | |
// } | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
app/src/main/java/ch/sdp/vibester/user/UserScoreboardAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters