Selaa lähdekoodia

Fix unit tests

Guy Carmeli 6 vuotta sitten
vanhempi
commit
0b7edc2e81

+ 1
- 0
lib/android/app/src/main/java/com/reactnativenavigation/views/titlebar/TitleBar.java Näytä tiedosto

@@ -216,6 +216,7 @@ public class TitleBar extends Toolbar {
216 216
     }
217 217
 
218 218
     public void setHeight(int height) {
219
+        if (height == getLayoutParams().height) return;
219 220
         ViewGroup.LayoutParams lp = getLayoutParams();
220 221
         lp.height = (int) UiUtils.dpToPx(getContext(), height);
221 222
         setLayoutParams(lp);

+ 1
- 0
lib/android/app/src/main/java/com/reactnativenavigation/views/topbar/TopBar.java Näytä tiedosto

@@ -74,6 +74,7 @@ public class TopBar extends AppBarLayout implements ScrollEventListener.ScrollAw
74 74
     }
75 75
 
76 76
     public void setHeight(int height) {
77
+        if (height == getLayoutParams().height) return;
77 78
         ViewGroup.LayoutParams lp = getLayoutParams();
78 79
         lp.height = (int) UiUtils.dpToPx(getContext(), height);
79 80
         setLayoutParams(lp);

+ 1
- 1
lib/android/app/src/test/java/com/reactnativenavigation/views/TopBarBackgroundComponentTest.java Näytä tiedosto

@@ -55,7 +55,7 @@ public class TopBarBackgroundComponentTest extends BaseTest {
55 55
         TopBarBackgroundView background = (TopBarBackgroundView) ViewUtils.findChildrenByClassRecursive(uut, TopBarBackgroundView.class).get(0);
56 56
         assertThat(background).isNotNull();
57 57
         assertThat(background.getLayoutParams().width).isEqualTo(ViewGroup.LayoutParams.MATCH_PARENT);
58
-        assertThat(background.getLayoutParams().height).isEqualTo(uut.getHeight());
58
+        assertThat(background.getLayoutParams().height).isEqualTo(100);
59 59
     }
60 60
 
61 61
     @Test