Skip to content

Commit

Permalink
Merge pull request #555 from appuio/492-display-name-as-title
Browse files Browse the repository at this point in the history
Use display name as title
  • Loading branch information
steffinchen authored Sep 6, 2023
2 parents 52fca6a + de459a1 commit dce4880
Show file tree
Hide file tree
Showing 30 changed files with 190 additions and 102 deletions.
1 change: 1 addition & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ export default defineConfig({
printLogsToConsole: 'always',
});
},
experimentalRunAllSpecs: true,
},
});
19 changes: 10 additions & 9 deletions cypress/e2e/billingentities.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ describe('Test billing entity list', () => {
cy.visit('/billingentities');
cy.get('#billingentities-title').should('contain.text', 'Billing');
cy.get('#addButton').should('contain.text', 'Add new Billing');
cy.get(':nth-child(2) > .flex-row > .text-3xl').should('contain.text', 'be-2345');
cy.get(':nth-child(3) > .flex-row > .text-3xl').should('contain.text', 'be-2347');
cy.get(':nth-child(2) > .flex-row > .text-3xl').should('contain.text', '➡️ Engineering GmbH');
cy.get(':nth-child(3) > .flex-row > .text-3xl').should('contain.text', '👁️ AG');
});

it('empty list', () => {
Expand Down Expand Up @@ -54,8 +54,8 @@ describe('Test billing entity list', () => {
cy.visit('/billingentities');

cy.get('#billingentities-title').should('contain.text', 'Billing');
cy.get(':nth-child(2) > .flex-row > .text-3xl').should('contain.text', 'be-2345');
cy.get(':nth-child(3) > .flex-row > .text-3xl').should('contain.text', 'be-2347');
cy.get(':nth-child(2) > .flex-row > .text-3xl').should('contain.text', '➡️ Engineering GmbH');
cy.get(':nth-child(3) > .flex-row > .text-3xl').should('contain.text', '👁️ AG');
});
});

Expand Down Expand Up @@ -132,10 +132,11 @@ describe('Test billing entity details', () => {
});
cy.visit('/billingentities/be-2345');
cy.get('.flex-wrap > .text-900').eq(0).should('contain.text', '➡️ Engineering GmbH');
cy.get('.flex-wrap > .text-900').eq(1).should('contain.text', '[email protected]');
cy.get('.flex-wrap > .text-900').eq(2).should('contain.text', '☎️');
cy.get('.flex-wrap > .text-900').eq(3).should('contain.text', '📃📋🏤 🏙️Switzerland');
cy.get('.flex-wrap > .text-900').eq(4).should('contain.text', 'mig [email protected]');
cy.get('.flex-wrap > .text-900').eq(5).should('contain.text', '🇩🇪');
cy.get('.flex-wrap > .text-900').eq(1).should('contain.text', 'be-2345');
cy.get('.flex-wrap > .text-900').eq(2).should('contain.text', '[email protected]');
cy.get('.flex-wrap > .text-900').eq(3).should('contain.text', '☎️');
cy.get('.flex-wrap > .text-900').eq(4).should('contain.text', '📃📋🏤 🏙️Switzerland');
cy.get('.flex-wrap > .text-900').eq(5).should('contain.text', 'mig [email protected]');
cy.get('.flex-wrap > .text-900').eq(6).should('contain.text', '🇩🇪');
});
});
28 changes: 15 additions & 13 deletions cypress/e2e/billingentity-form.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,13 @@ describe('Test billing entity create', () => {
cy.url().should('include', '/billingentities/be-2345').should('not.include', '?edit=y');
cy.get('.flex-wrap > .text-900').eq(0).should('contain.text', '➡️ Engineering GmbH');

cy.get('#title').should('contain.text', 'be-2345');
cy.get('.flex-wrap > .text-900').eq(1).should('contain.text', '[email protected]');
cy.get('.flex-wrap > .text-900').eq(2).should('contain.text', '☎️');
cy.get('.flex-wrap > .text-900').eq(3).should('contain.text', '📃📋🏤 🏙️Switzerland');
cy.get('.flex-wrap > .text-900').eq(4).should('contain.text', 'mig [email protected]');
cy.get('.flex-wrap > .text-900').eq(5).should('contain.text', '🇩🇪');
cy.get('#title').should('contain.text', '➡️ Engineering GmbH');
cy.get('.flex-wrap > .text-900').eq(1).should('contain.text', 'be-2345');
cy.get('.flex-wrap > .text-900').eq(2).should('contain.text', '[email protected]');
cy.get('.flex-wrap > .text-900').eq(3).should('contain.text', '☎️');
cy.get('.flex-wrap > .text-900').eq(4).should('contain.text', '📃📋🏤 🏙️Switzerland');
cy.get('.flex-wrap > .text-900').eq(5).should('contain.text', 'mig [email protected]');
cy.get('.flex-wrap > .text-900').eq(6).should('contain.text', '🇩🇪');
});

it('should forward to organizations if first time', () => {
Expand Down Expand Up @@ -315,7 +316,7 @@ describe('Test billing entity edit', () => {
}).as('updateBillingEntity');

cy.visit('/billingentities/be-2345');
cy.get('#title').should('contain.text', 'be-2345');
cy.get('#title').should('contain.text', '➡️ Engineering GmbH');

cy.get('svg[class*="fa-pen-to-square"]').click();

Expand Down Expand Up @@ -364,19 +365,20 @@ describe('Test billing entity edit', () => {
cy.get('p-toast').should('contain.text', 'Successfully saved');
cy.url().should('include', '/billingentities/be-2345').should('not.include', '?edit=y');
// check values
cy.get('#title').should('contain.text', 'be-2345');
cy.get('#title').should('contain.text', 'nxt Engineering');
cy.get('.flex-wrap > .text-900').eq(0).should('contain.text', 'nxt Engineering');
cy.get('.flex-wrap > .text-900').eq(1).should('contain.text', 'be-2345');
cy.get('.flex-wrap > .text-900')
.eq(1)
.eq(2)
.should('contain.text', '[email protected]')
.should('contain.text', '[email protected]');
cy.get('.flex-wrap > .text-900').eq(2).should('contain.text', '1234');
cy.get('.flex-wrap > .text-900').eq(3).should('contain.text', '1234');
cy.get('.flex-wrap > .text-900')
.eq(3)
.eq(4)
.should('contain.text', 'line1')
.should('contain.text', '4321 Berlin')
.should('contain.text', 'Germany');
cy.get('.flex-wrap > .text-900').eq(4).should('contain.text', 'crc [email protected]');
cy.get('.flex-wrap > .text-900').eq(5).should('contain.text', '🇩🇪');
cy.get('.flex-wrap > .text-900').eq(5).should('contain.text', 'crc [email protected]');
cy.get('.flex-wrap > .text-900').eq(6).should('contain.text', '🇩🇪');
});
});
12 changes: 6 additions & 6 deletions cypress/e2e/billingentity-members.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe('billing entity edit members with existing roles', () => {
).as('updateAdmin');

cy.visit('/billingentities/be-2345/members');
cy.get('.text-3xl').should('contain.text', 'be-2345 Members');
cy.get('.text-3xl').should('contain.text', '➡️ Engineering GmbH Members');
cy.get('[data-cy="name-input-1"]').type('crc');
cy.get('p-multiselect').eq(1).click().contains('billingentities-be-2345-admin').click();
cy.get('button[type=submit]').click();
Expand Down Expand Up @@ -139,7 +139,7 @@ describe('billing entity edit members with existing roles', () => {
).as('updateAdmin');

cy.visit('/billingentities/be-2345/members');
cy.get('.text-3xl').should('contain.text', 'be-2345 Members');
cy.get('.text-3xl').should('contain.text', '➡️ Engineering GmbH Members');
cy.get('button[title="Remove"]').eq(1).click();
cy.get('button[type=submit]').click();
cy.wait('@updateViewer');
Expand Down Expand Up @@ -188,7 +188,7 @@ describe('billing entity edit members with existing roles', () => {
);

cy.visit('/billingentities/be-2345/members');
cy.get('.text-3xl').should('contain.text', 'be-2345 Members');
cy.get('.text-3xl').should('contain.text', '➡️ Engineering GmbH Members');
cy.get('button[title="Remove"]').eq(0).click();
cy.get('p-message').contains('You are about to remove yourself as admin!');
});
Expand Down Expand Up @@ -239,7 +239,7 @@ describe('billing entity edit members with existing roles', () => {
).as('updateAdmin');

cy.visit('/billingentities/be-2345/members');
cy.get('.text-3xl').should('contain.text', 'be-2345 Members');
cy.get('.text-3xl').should('contain.text', '➡️ Engineering GmbH Members');
const multiSelect = cy.get('p-multiselect').eq(1);
multiSelect.click();
multiSelect.get('p-multiselectitem').contains('billingentities-be-2345-admin').click();
Expand Down Expand Up @@ -283,7 +283,7 @@ describe('billing entity edit members with existing roles', () => {
}
);
cy.visit('/billingentities/be-2345/members');
cy.get('.text-3xl').should('contain.text', 'be-2345 Members');
cy.get('.text-3xl').should('contain.text', '➡️ Engineering GmbH Members');
const multiSelect = cy.get('p-multiselect').eq(0);
multiSelect.click();
multiSelect.get('p-multiselectitem').contains('billingentities-be-2345-admin').click();
Expand Down Expand Up @@ -370,7 +370,7 @@ describe('billing entity edit members without initial roles', () => {
}).as('createRoleBinding');

cy.visit('/billingentities/be-2345/members');
cy.get('.text-3xl').should('contain.text', 'be-2345 Members');
cy.get('.text-3xl').should('contain.text', '➡️ Engineering GmbH Members');
cy.get('[data-cy="name-input-0"]').type('crc');
cy.get('p-multiselect').eq(0).click().contains('billingentities-be-2345-admin').click();
cy.get('button[type=submit]').click();
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/invitations-accept.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ describe('Test invitation accept for existing user', () => {
).as('getInvitation');

cy.visit('/organizations');
cy.get(':nth-child(2) > .flex-row > .text-3xl').should('contain.text', 'vshn');
cy.get(':nth-child(2) > .flex-row > .text-3xl').should('contain.text', 'VSHN - the DevOps Company');

cy.visit('/invitations/e303b166-5d66-4151-8f5f-b84ba84a7559?token=93c05fe3-b20f-48cf-aea6-39eb2350d640');
cy.wait('@createInvitationRedeemRequest');
Expand All @@ -239,8 +239,8 @@ describe('Test invitation accept for existing user', () => {
cy.get('p-toast').should('contain.text', 'Invitation accepted');

cy.get('app-navbar-item').contains('Organizations').click();
cy.get(':nth-child(2) > .flex-row > .text-3xl').should('contain.text', 'vshn');
cy.get(':nth-child(3) > .flex-row > .text-3xl').should('contain.text', 'nxt');
cy.get(':nth-child(2) > .flex-row > .text-3xl').should('contain.text', 'VSHN - the DevOps Company');
cy.get(':nth-child(3) > .flex-row > .text-3xl').should('contain.text', 'nxt Engineering GmbH');
});

it('should display message even if navigated away', () => {
Expand Down Expand Up @@ -285,7 +285,7 @@ describe('Test invitation accept for existing user', () => {
cy.get('#title').should('contain.text', 'Invitation');

cy.get('app-navbar-item').contains('Organizations').click();
cy.get(':nth-child(2) > .flex-row > .text-3xl').should('contain.text', 'nxt');
cy.get(':nth-child(2) > .flex-row > .text-3xl').should('contain.text', 'nxt Engineering GmbH');
cy.get('p-toast', { timeout: 10000 }).should('contain.text', 'Invitation accepted');
});
});
Expand Down
10 changes: 5 additions & 5 deletions cypress/e2e/organization-form.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('Test organization add', () => {
expect(body.spec.displayName).to.eq('VSHN - the DevOps Company');
expect(body.spec.billingEntityRef).to.eq('be-2347');
});
cy.get(':nth-child(3) > .flex-row > .text-3xl').should('contain.text', 'vshn');
cy.get(':nth-child(3) > .flex-row > .text-3xl').should('contain.text', 'VSHN - the DevOps Company');
cy.get(':nth-child(3) > .border-top-1 > .list-none > .flex > .text-900').should(
'contain.text',
'VSHN - the DevOps Company'
Expand Down Expand Up @@ -196,12 +196,12 @@ describe('Test organization edit', () => {
'contain.text',
'nxt Engineering GmbH'
);
cy.get(':nth-child(3) > .flex-row > .text-3xl').should('contain.text', 'vshn');
cy.get(':nth-child(3) > .flex-row > .text-3xl').should('contain.text', 'VSHN AG');
cy.get(':nth-child(3) > .border-top-1 > .list-none > .flex > .text-900').should('contain.text', 'VSHN AG');

cy.get(':nth-child(2) > .flex-row [title="Edit organization"]').should('not.exist');
cy.get(':nth-child(3) > .flex-row [title="Edit organization"]').click();
cy.get('.text-3xl').should('contain.text', 'vshn');
cy.get('#title').should('contain.text', 'vshn');
cy.get('#selectedBillingEntity').should('contain.text', '👁️ AG');
cy.get('#displayName').type('{selectall}');
cy.get('#displayName').type('VSHN - the DevOps Company');
Expand All @@ -215,12 +215,12 @@ describe('Test organization edit', () => {
expect(body.spec.displayName).to.eq('VSHN - the DevOps Company');
expect(body.spec.billingEntityRef).to.eq('be-2345');
});
cy.get(':nth-child(2) > .flex-row > .text-3xl').should('contain.text', 'nxt');
cy.get(':nth-child(2) > .flex-row > .text-3xl').should('contain.text', 'nxt Engineering GmbH');
cy.get(':nth-child(2) > .border-top-1 > .list-none > .flex > .text-900').should(
'contain.text',
'nxt Engineering GmbH'
);
cy.get(':nth-child(3) > .flex-row > .text-3xl').should('contain.text', 'vshn');
cy.get(':nth-child(3) > .flex-row > .text-3xl').should('contain.text', 'VSHN - the DevOps Company');
cy.get(':nth-child(3) > .border-top-1 > .list-none > .flex > .text-900').should(
'contain.text',
'VSHN - the DevOps Company'
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/organization-members.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('Test organization members', () => {
cy.visit('/organizations');
cy.get('#organizations-title').should('contain.text', 'Organizations');
cy.get(':nth-child(2) > .flex-row [title="Edit members"]').click();
cy.get('.text-3xl').should('contain.text', 'nxt Members');
cy.get('.text-3xl').should('contain.text', 'nxt Engineering GmbH Members');
cy.get('[data-cy="name-input-0"]').should('have.value', 'hans.meier').and('be.disabled');
cy.get('[data-cy="name-input-1"]').should('have.value', 'peter.muster').and('be.disabled');
cy.get(':nth-child(2) .p-multiselect')
Expand Down Expand Up @@ -112,7 +112,7 @@ describe('Test organization members', () => {
cy.get(':nth-child(2) > .flex-row [title="Edit members"]').should('exist');
cy.get(':nth-child(3) > .flex-row [title="Edit members"]').should('not.exist');
cy.get(':nth-child(2) > .flex-row [title="Edit members"]').click();
cy.get('.text-3xl').should('contain.text', 'nxt Members');
cy.get('.text-3xl').should('contain.text', 'nxt Engineering GmbH Members');
cy.get('[data-cy="name-input-0"]').should('have.value', 'hans.meier');
cy.get('[data-cy="name-input-1"]').should('have.value', 'peter.muster');
cy.get('[data-cy="name-input-1"]').type('{selectall}test');
Expand Down Expand Up @@ -190,7 +190,7 @@ describe('Test organization members', () => {
cy.visit('/organizations');
cy.get('#organizations-title').should('contain.text', 'Organizations');
cy.get(':nth-child(2) > .flex-row [title="Edit members"]').click();
cy.get('.text-3xl').should('contain.text', 'nxt Members');
cy.get('.text-3xl').should('contain.text', 'nxt Engineering GmbH Members');
cy.get('[data-cy="name-input-0"]').first().should('have.value', 'hans.meier');
cy.get('[data-cy="name-input-1"]').should('have.value', 'peter.muster');
cy.get('[data-cy="name-input-2"]').type('{selectall}test');
Expand Down
12 changes: 6 additions & 6 deletions cypress/e2e/organizations.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ describe('Test organization list', () => {
setOrganization(cy, ...organizationListNxtVshn.items);
cy.visit('/organizations');
cy.get('#organizations-title').should('contain.text', 'Organizations');
cy.get(':nth-child(2) > .flex-row > .text-3xl').should('contain.text', 'nxt');
cy.get(':nth-child(3) > .flex-row > .text-3xl').should('contain.text', 'vshn');
cy.get(':nth-child(2) > .flex-row > .text-3xl').should('contain.text', 'nxt Engineering GmbH');
cy.get(':nth-child(3) > .flex-row > .text-3xl').should('contain.text', 'VSHN - the DevOps Company');
});

it('list with edit permissions', () => {
Expand All @@ -43,7 +43,7 @@ describe('Test organization list', () => {
setOrganization(cy, createOrganization({ name: 'nxt', displayName: 'nxt Engineering', billingRef: 'be-2345' }));
cy.visit('/organizations');
cy.get('#organizations-title').should('contain.text', 'Organizations');
cy.get(':nth-child(2) > .flex-row > .text-3xl').should('contain.text', 'nxt');
cy.get(':nth-child(2) > .flex-row > .text-3xl').should('contain.text', 'nxt Engineering');
cy.get('svg[class*="fa-pen-to-square"]').should('exist');
cy.get('svg[class*="fa-dollar-sign"]').should('exist');
cy.get('svg[class*="fa-user-group"]').should('exist');
Expand Down Expand Up @@ -77,8 +77,8 @@ describe('Test organization list', () => {
});
cy.visit('/organizations');

cy.get(':nth-child(2) > .flex-row > .text-3xl').should('contain.text', 'nxt');
cy.get(':nth-child(3) > .flex-row > .text-3xl').should('contain.text', 'vshn');
cy.get(':nth-child(2) > .flex-row > .text-3xl').should('contain.text', 'nxt Engineering GmbH');
cy.get(':nth-child(3) > .flex-row > .text-3xl').should('contain.text', 'VSHN - the DevOps Company');
});
});

Expand Down Expand Up @@ -154,7 +154,7 @@ describe('Test limited permissions', () => {
setOrganization(cy, org);
cy.visit('/organizations');
cy.get('#organizations-title').should('contain.text', 'Organizations');
cy.get(':nth-child(2) > .flex-row > .text-3xl').should('contain.text', 'vshn');
cy.get(':nth-child(2) > .flex-row > .text-3xl').should('contain.text', 'VSHN - the DevOps Company');
cy.get('svg[class*="fa-pen-to-square"]').should('not.exist');
cy.get('svg[class*="fa-dollar-sign"]').should('not.exist');
cy.get('svg[class*="fa-user-group"]').should('exist');
Expand Down
Loading

0 comments on commit dce4880

Please sign in to comment.