Skip to content

Commit

Permalink
test fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
himdel committed Mar 15, 2024
1 parent 61675a8 commit 04711bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
5 changes: 0 additions & 5 deletions test/cypress/e2e/groups_and_users/user_detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ describe('user detail tests all fields, editing, and deleting', () => {
cy.get('[data-cy="DataForm-field-last_name"]').contains('last_name');
cy.get('[data-cy="DataForm-field-email"]').contains('example@example.com');
cy.get('[data-cy="UserForm-readonly-groups"]').contains(`alphaGroup${num}`);
// FIXME test the right value, not both
cy.get('.pf-v5-c-switch > .pf-v5-c-switch__label').should(
'have.text',
'Super userNot a super user',
);
});

it('edits user', () => {
Expand Down
14 changes: 5 additions & 9 deletions test/cypress/e2e/misc/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@ describe('My Profile Tests', () => {

beforeEach(() => {
cy.login();
// open the dropdown labeled with the username and then...
cy.get('[data-cy="user-dropdown"] button').click();
// a little hacky, but basically
// just click the one link that says 'My profile'.
cy.get('a').contains('My profile').click();
cy.get('button:contains("Edit")').click();
cy.contains('a', 'My profile').click();
cy.contains('button', 'Edit').click();
});

it('only has input fields for name, email, username, password and pass confirmation', () => {
Expand Down Expand Up @@ -51,7 +48,8 @@ describe('My Profile Tests', () => {
cy.login(username, password);

cy.get('[data-cy="user-dropdown"] button').click();
cy.get('a').contains('My profile').click();
cy.contains('a', 'My profile').click();
cy.contains('button', 'Edit').click();

cy.get('.pf-v5-c-switch__input').should('be.disabled');
});
Expand Down Expand Up @@ -102,9 +100,7 @@ describe('My Profile Tests', () => {
});

it('groups input is readonly', () => {
cy.get('[data-cy="UserForm-readonly-groups"]')
.find('input')
.should('not.exist');
cy.get('[data-cy="UserForm-readonly-groups"]').should('not.exist');
});

it('user can save form', () => {
Expand Down

0 comments on commit 04711bd

Please sign in to comment.