FileUploadPopupView extends AbstractScenarioPopupView implements FileUploadPopup { @Override public void show(final String mainTitleText, final String okButtonText, final Command okCommand) { fileContents = ""; fileText.setValue(""); if (!acceptedExtension.isEmpty()) { file.setAccept(String.join(",", acceptedExtension)); } okButton.setEnabled(false); super.show(mainTitleText, okButtonText, okCommand); }  static void fileLoaded(String fileContents); @Override void init(); @Override void show(final String mainTitleText,
                     final String okButtonText,
                     final Command okCommand); @Override void show(final String mainTitleText,
                     final String uploadWarningText,
                     final String okButtonText,
                     final Command okCommand); @Override String getFileContents(); @Override String getFileName(); @Override void setAcceptedExtension(List<String> acceptedExtension); @EventHandler("chooseButton") void onChooseButtonClickEvent(ClickEvent clickEvent); @EventHandler("file") void onFileChangeEvent(ChangeEvent event); static native void readTextFile(JavaScriptObject files);  }
@Test public void show() { popupView.show("mainText", "okButtonText", okButtonCommandMock); verify(fileTextMock, times(1)).setValue(eq("")); verify(okButtonMock, times(1)).setEnabled(eq(false)); }
@Test public void showWithUploadWarning() { ((FileUploadPopupView) popupView).show("mainText", "uploadWarning", "okButtonText", okButtonCommandMock); verify(uploadWarningMock, times(1)).setInnerText(eq("uploadWarning")); verify(((FileUploadPopupView) popupView), times(1)).show(eq("mainText"), eq("okButtonText"), eq(okButtonCommandMock)); }