Skip to content

Commit

Permalink
feat: added thread in tests of FileDetailsFragmentTest
Browse files Browse the repository at this point in the history
  • Loading branch information
Aitorbp committed Apr 26, 2024
1 parent 1a78153 commit 550cabb
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class FileDetailsFragmentTest {

@Test
fun show_space_personal_when_it_has_value() {
Thread.sleep(1000)
R.id.fdSpace.assertVisibility(ViewMatchers.Visibility.VISIBLE)
R.id.fdSpaceLabel.assertVisibility(ViewMatchers.Visibility.VISIBLE)
R.id.fdIconSpace.assertVisibility(ViewMatchers.Visibility.VISIBLE)
Expand All @@ -103,6 +104,7 @@ class FileDetailsFragmentTest {
R.id.fdSpaceLabel.withText(R.string.space_label)
onView(withId(R.id.fdIconSpace))
.check(matches(withDrawable(R.drawable.ic_spaces)))
Thread.sleep(500)
}

@Test
Expand All @@ -116,16 +118,18 @@ class FileDetailsFragmentTest {

@Test
fun show_space_not_personal_when_it_has_value() {
Thread.sleep(1000)
every { fileDetailsViewModel.currentFile } returns currentFileWithoutPersonalSpace

Thread.sleep(500)
R.id.fdSpace.assertVisibility(ViewMatchers.Visibility.VISIBLE)
R.id.fdSpaceLabel.assertVisibility(ViewMatchers.Visibility.VISIBLE)
R.id.fdIconSpace.assertVisibility(ViewMatchers.Visibility.VISIBLE)

Thread.sleep(500)
R.id.fdSpace.withText(currentFileWithoutPersonalSpace.value?.space?.name.toString())
R.id.fdSpaceLabel.withText(R.string.space_label)
onView(withId(R.id.fdIconSpace))
.check(matches(withDrawable(R.drawable.ic_spaces)))
Thread.sleep(500)
}

@Test
Expand Down

0 comments on commit 550cabb

Please sign in to comment.