diff --git a/app/src/androidTest/java/ch/sdp/vibester/fragment/ScoreBoardFragmentTest.kt b/app/src/androidTest/java/ch/sdp/vibester/fragment/ScoreBoardFragmentTest.kt index 2968ca0af..6a7673128 100644 --- a/app/src/androidTest/java/ch/sdp/vibester/fragment/ScoreBoardFragmentTest.kt +++ b/app/src/androidTest/java/ch/sdp/vibester/fragment/ScoreBoardFragmentTest.kt @@ -1,7 +1,6 @@ package ch.sdp.vibester.fragment import androidx.recyclerview.widget.RecyclerView -import androidx.test.core.app.ApplicationProvider import androidx.test.espresso.Espresso.onView import androidx.test.espresso.action.ViewActions.click import androidx.test.espresso.assertion.ViewAssertions.matches @@ -46,19 +45,19 @@ class ScoreBoardFragmentTest { @Test fun genreShouldDisappearAfterSelected() { onView(withId(R.id.genrePerScoreboard)).check(matches(isDisplayed())) - onView(withId(R.id.rockButton)).perform(click()) + onView(withId(R.id.scoreboard_rockButton)).perform(click()) onView(withId(R.id.genrePerScoreboard)).check(matches(not(isDisplayed()))) } @Test fun rockBtnShouldSetUpRecycleView() { - onView(withId(R.id.rockButton)).perform(click()) + onView(withId(R.id.scoreboard_rockButton)).perform(click()) onView(withId(R.id.scoreboard_content_scrolling)).check(matches(isDisplayed())) } @Test fun clickOnItemShouldGoesToProfileAndDisplaysScores() { - onView(withId(R.id.rockButton)).perform(click()) + onView(withId(R.id.scoreboard_rockButton)).perform(click()) onView((withId(R.id.recycler_view))) .perform( @@ -73,26 +72,26 @@ class ScoreBoardFragmentTest { @Test fun topBtnClick() { - onView(withId(R.id.topTracksButton)).perform(click()) + onView(withId(R.id.scoreboard_topTracksButton)).perform(click()) } @Test fun kpopBtnClick() { - onView(withId(R.id.kpopButton)).perform(click()) + onView(withId(R.id.scoreboard_kpopButton)).perform(click()) } @Test fun billieEilishButtonClick() { - onView(withId(R.id.billieEilishButton)).perform(click()) + onView(withId(R.id.scoreboard_billieEilishButton)).perform(click()) } @Test fun imagineDragonsButtonClick() { - onView(withId(R.id.imagDragonsButton)).perform(click()) + onView(withId(R.id.scoreboard_imagDragonsButton)).perform(click()) } @Test fun btsButtonClick() { - onView(withId(R.id.btsButton)).perform(click()) + onView(withId(R.id.scoreboard_btsButton)).perform(click()) } } \ No newline at end of file diff --git a/app/src/main/java/ch/sdp/vibester/fragment/ScoreBoardFragment.kt b/app/src/main/java/ch/sdp/vibester/fragment/ScoreBoardFragment.kt index 21ebc5ade..401d4cc0d 100644 --- a/app/src/main/java/ch/sdp/vibester/fragment/ScoreBoardFragment.kt +++ b/app/src/main/java/ch/sdp/vibester/fragment/ScoreBoardFragment.kt @@ -43,12 +43,12 @@ class ScoreBoardFragment : Fragment(), OnItemClickListener, View.OnClickListener val view = inflater.inflate(R.layout.fragment_scoreboard, container, false) val ctx = inflater.context - view.findViewById