@Test public void testOnFocus() { final HTMLElement flashMessagesElement = mock(HTMLElement.class); final HTMLElement includedModelsPresenterElement = mock(HTMLElement.class); final Element currentElement = mock(Element.class); when(flashMessages.getElement()).thenReturn(flashMessagesElement); when(includedModelsPresenter.getElement()).thenReturn(includedModelsPresenterElement); pageView.firstChild = currentElement; when(pageView.removeChild(currentElement)).then(a -> { pageView.firstChild = null; return currentElement; }); page.onFocus(); verify(pageView).removeChild(currentElement); verify(pageView).appendChild(flashMessagesElement); verify(pageView).appendChild(includedModelsPresenterElement); }
@Override public void onFocus() { RemoveHelper.removeChildren(getPageView()); getPageView().appendChild(getFlashMessages().getElement()); getPageView().appendChild(getIncludedModelsPresenter().getElement()); }
IncludedModelsPage extends DMNPage { @Override public void onFocus() { RemoveHelper.removeChildren(getPageView()); getPageView().appendChild(getFlashMessages().getElement()); getPageView().appendChild(getIncludedModelsPresenter().getElement()); } }
IncludedModelsPage extends DMNPage { @Override public void onFocus() { RemoveHelper.removeChildren(getPageView()); getPageView().appendChild(getFlashMessages().getElement()); getPageView().appendChild(getIncludedModelsPresenter().getElement()); } @Inject  IncludedModelsPage(final HTMLDivElement pageView,
                              final TranslationService translationService,
                              final FlashMessages flashMessages,
                              final IncludedModelsPagePresenter includedModelsPresenter,
                              final IncludedModelsPageState pageState,
                              final IncludedModelsPageStateProvider stateProvider); }
IncludedModelsPage extends DMNPage { @Override public void onFocus() { RemoveHelper.removeChildren(getPageView()); getPageView().appendChild(getFlashMessages().getElement()); getPageView().appendChild(getIncludedModelsPresenter().getElement()); } @Inject  IncludedModelsPage(final HTMLDivElement pageView,
                              final TranslationService translationService,
                              final FlashMessages flashMessages,
                              final IncludedModelsPagePresenter includedModelsPresenter,
                              final IncludedModelsPageState pageState,
                              final IncludedModelsPageStateProvider stateProvider); @Override void onFocus(); @Override void onLostFocus(); void reload(); }
IncludedModelsPage extends DMNPage { @Override public void onFocus() { RemoveHelper.removeChildren(getPageView()); getPageView().appendChild(getFlashMessages().getElement()); getPageView().appendChild(getIncludedModelsPresenter().getElement()); } @Inject  IncludedModelsPage(final HTMLDivElement pageView,
                              final TranslationService translationService,
                              final FlashMessages flashMessages,
                              final IncludedModelsPagePresenter includedModelsPresenter,
                              final IncludedModelsPageState pageState,
                              final IncludedModelsPageStateProvider stateProvider); @Override void onFocus(); @Override void onLostFocus(); void reload();  }