Skip to content

Commit

Permalink
#2474 Add test for user names
Browse files Browse the repository at this point in the history
  • Loading branch information
dwalizer committed Nov 27, 2023
1 parent a5be9c6 commit 0ad976a
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions e2e-tests/cypress/e2e/users_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,33 @@ describe('Users Tests', () => {
}
});

it('displays user name if available', () => {
const res = `
{"data":
[
{"userIdForDisplay":"[email protected]","firstName":"Skill","lastName":"Tree","email":"[email protected]","dn":null,"userId":"[email protected]","totalPoints":492,"lastUpdated":"2021-03-04T19:22:44.714+00:00"},
{"userIdForDisplay":"[email protected]","firstName":"Skill","lastName":"Tree","email":"[email protected]","dn":null,"userId":"[email protected]","totalPoints":492,"lastUpdated":"2021-03-04T19:22:44.714+00:00"},
{"userIdForDisplay":"foo-hydra","firstName":"","lastName":"","email":"[email protected]","dn":null,"userId":"[email protected]","totalPoints":492,"lastUpdated":"2021-03-04T19:22:44.714+00:00"}
],
"count":3,"totalCount":3}`;
cy.intercept('/admin/projects/proj1/users?query=*', {
statusCode: 200,
body: res,
}).as('getUsers');

cy.request('POST', `/api/projects/proj1/skills/skill1`);

cy.visit('/administrator/projects/proj1/');
cy.clickNav('Users');
cy.wait('@getUsers')

cy.validateTable(tableSelector, [
[{colIndex: 0, value: '[email protected] (Tree, Skill)'}],
[{colIndex: 0, value: '[email protected] (Tree, Skill)'}],
[{colIndex: 0, value: 'foo-hydra'}]
], 5);
});

it('reset should reset paging', () => {
cy.intercept('/admin/projects/proj1/users?query=*')
.as('getUsers');
Expand Down

0 comments on commit 0ad976a

Please sign in to comment.