package org.wikipedia.navtab;

import android.support.annotation.NonNull;

import org.junit.experimental.theories.Theory;
import org.junit.experimental.theories.suppliers.TestedOn;
import org.wikipedia.test.ViewTest;
import org.wikipedia.theme.Theme;

public class NavTabViewTest extends ViewTest {
    private NavTabView subject;

    @Theory public void testWidth(@TestedOn(ints = {WIDTH_DP_XL, WIDTH_DP_XS}) int widthDp,
                                  float fontScale) {
        setUp(widthDp, LayoutDirection.LOCALE, fontScale, Theme.LIGHT);
        snap(subject);
    }

    @Theory public void testLayoutDirection(@TestedOn(ints = {WIDTH_DP_L, WIDTH_DP_XS}) int widthDp,
                                            LayoutDirection direction) {
        setUp(widthDp, direction, 1, Theme.LIGHT);
        snap(subject);
    }

    @Theory public void testTheme(Theme theme) {
        setUp(WIDTH_DP_XS, LayoutDirection.LOCALE, 1, theme);
        snap(subject);
    }

    @Theory public void testSelect(Theme theme) {
        setUp(WIDTH_DP_XS, LayoutDirection.LOCALE, 1, theme);
        subject.setSelected(true);
        snap(subject);
    }

    @Override protected void setUp(int widthDp, @NonNull LayoutDirection layoutDirection,
                                   float fontScale, @NonNull Theme theme) {
        super.setUp(widthDp, layoutDirection, fontScale, theme);

        subject = new NavTabView(ctx())
                .text(NavTab.EXPLORE.text())
                .icon(NavTab.EXPLORE.icon());
    }
}
@@ -68,16 +68,39 @@
 nNull;%0A%0A
+import org.junit.Test;%0A
 import o
@@ -268,16 +268,202 @@
 Theme;%0A%0A
+import static org.hamcrest.Matchers.hasItemInArray;%0Aimport static org.hamcrest.Matchers.is;%0Aimport static org.hamcrest.Matchers.notNullValue;%0Aimport static org.junit.Assert.assertThat;%0A%0A
 public c
@@ -1350,24 +1350,410 @@
 ct);%0A    %7D%0A%0A
+    @Test public void testText() %7B%0A        setUp(WIDTH_DP_XS, LayoutDirection.LOCALE, 1, Theme.LIGHT);%0A        assertThat(subject.getText().toString(), is(str(NavTab.EXPLORE.text())));%0A    %7D%0A%0A    @Test public void testIcon() %7B%0A        setUp(WIDTH_DP_XS, LayoutDirection.LOCALE, 1, Theme.LIGHT);%0A        assertThat(subject.getCompoundDrawables(), hasItemInArray(notNullValue()));%0A    %7D%0A%0A
     @Overrid

Add missing interface tests to NavTabViewTest