@Test public void bridgeOnVisibilityChanged_withTwoPartBridgeAttached_shouldNotNotifyVisibility() { when(mockTwoPartBridge.isAttached()).thenReturn(true); bridgeListenerCaptor.getValue().onVisibilityChanged(true); bridgeListenerCaptor.getValue().onVisibilityChanged(false); verify(mockBridge, never()).notifyViewability(anyBoolean()); verify(mockTwoPartBridge, never()).notifyViewability(anyBoolean()); }
@Test public void handleClose_fromTwoPartExpandedState_shouldDetachTwoPartBridge_shouldMoveWebViewToOriginalContainer_shouldNotFireOnClose() throws MraidCommandException { URI uri = URI.create("https://two-part-url"); // Move to two part EXPANDED state subject.handlePageLoad(); subject.handleExpand(uri, false); when(mockTwoPartBridge.isAttached()).thenReturn(true); subject.handleClose(); verify(mockTwoPartBridge).detach(); assertThat(subject.getExpandedAdContainer().getChildCount()).isEqualTo(1); assertThat(subject.getAdContainer().getChildCount()).isEqualTo(1); assertThat(subject.getViewState()).isEqualTo(ViewState.DEFAULT); verify(mockMraidListener, never()).onClose(); }