Skip to content

Commit

Permalink
Further expands tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CGoodwin90 committed Jul 26, 2024
1 parent da3f424 commit 9087d6b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cypress/support/actions/settings/SettingsAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class SettingAction {
}

deleteSshKey(name: string) {
settings.getDeleteBtn().click();
settings.getDeleteBtn(name);
cy.log('enter the name and confirm');
cy.getBySel('confirm-input').type(name);
cy.getBySel('deleteConfirm').click();
Expand Down
13 changes: 11 additions & 2 deletions cypress/support/repositories/settings/SettingsRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ export default class SettingsRepository {
getSubmitBtn() {
return cy.getBySel('sshKey').parent().next();
}
getDeleteBtn() {
return cy.getBySel('deleteKey').getBySel('delete');

getKeyToDelete() {
return cy.getBySel('data-row');
}
getDeleteBtn(name: string) {
this.getKeyToDelete()
.contains(name)
.parent()
.within(() => {
cy.getBySel('deleteKey').getBySel('delete').click();
});
}
}
2 changes: 1 addition & 1 deletion src/components/SshKeys/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const SshKeys = ({ me: { id, email, sshKeys: keys }, loading, handleRefetch }) =

{keys &&
keys.map(key => (
<div className="data-row" key={key.id}>
<div className="data-row" key={key.id} data-cy="data-row">
<div className="name">
{key.id} - {key.name}
</div>
Expand Down

0 comments on commit 9087d6b

Please sign in to comment.