Skip to content
This repository was archived by the owner on Feb 26, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ public interface AccountView {
void accountIsDeleted();

void passwordIsGenereated(String generatedPassword);

void showAccountRelatedError(String string);

}
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,15 @@ public void accountIsDeleted() {
public void passwordIsGenereated(String generatedPassword) {
SwingUtilities.invokeLater(() -> textFieldGeneratedPassword.setText(generatedPassword));
}

@Override
public void showAccountRelatedError(String string) {
SwingUtilities.invokeLater(() -> {
labelOperationResult.setEnabled(true);
labelOperationResult.setText(string);
});

}

public void setAccountController(AccountController accountController) {
this.accountController = accountController;
Expand All @@ -708,4 +717,6 @@ private void resetAccountAddedLabel() {
});
}



}
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ public void testAccountIsDeletedShowLabelWithSuccessInfo() {
accountSwingView.accountIsDeleted();
window.label("labelOperationResult").requireEnabled();
window.label("labelOperationResult").requireText("Account Deleted!");

}

@Test
Expand Down Expand Up @@ -479,6 +478,18 @@ public void testDeleteAccountDelegateControllerDeleteAccount() {
verify(accountController).delete(new Account("github.com", new Credential("giulio", "passgiulio")));
}

@Test
@GUITest
public void testModifyOperationErrorShowLabel() {
window.tabbedPane("tabbedPanel").selectTab(1);
window.panel("panelDisplayedAccounts").focus();
window.label("labelOperationResult").requireDisabled();
window.label("labelOperationResult").requireText("");
accountSwingView.showAccountRelatedError("Generic Error");
window.label("labelOperationResult").requireEnabled();
window.label("labelOperationResult").requireText("Generic Error");
}

private void resetInputTextAccountCredential() {
window.textBox("textFieldSiteName").deleteText();
window.textBox("textFieldUsername").deleteText();
Expand Down