square/assertj-android

TabLayoutAssert.hasTabMode throws an exception

arturdm opened this issue · 1 comments

Calling TabLayoutAssert.hasTabMode() on a TabLayout with more than 1 tab:

TabLayout tabLayout = (TabLayout) mainActivity.findViewById(R.id.tab_layout);
assertThat(tabLayout).hasTabMode(TabLayout.MODE_FIXED);

throws an exception. Here's the stacktrace:

java.lang.IllegalStateException: Unknown value: 2
    at org.assertj.android.internal.IntegerUtils$NamedValueStringBuilder.get(IntegerUtils.java:74)
    at org.assertj.android.design.api.widget.TabLayoutAssert.modeToString(TabLayoutAssert.java:64)
    at org.assertj.android.design.api.widget.TabLayoutAssert.hasTabMode(TabLayoutAssert.java:42)
    at org.assertj.android.design.api.widget.TabLayoutAssert.hasFixedTabs(TabLayoutAssert.java:48)
    at com.dicedmelon.MainActivityTest.shouldHaveFixedTabs(MainActivityTest.java:25)

#170 should fix this