-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #440 from dnum-mi/develop
Develop
- Loading branch information
Showing
104 changed files
with
2,560 additions
and
1,008 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { getOrganizations } from '../../support/func.js' | ||
import { statusDict, formatDate } from 'shared' | ||
|
||
describe('Administration projects', () => { | ||
const organizations = getOrganizations() | ||
let projects | ||
|
||
beforeEach(() => { | ||
cy.intercept('GET', 'api/v1/admin/projects').as('getAllProjects') | ||
|
||
cy.kcLogin('tcolin') | ||
cy.visit('/admin/projects') | ||
cy.url().should('contain', '/admin/projects') | ||
cy.wait('@getAllProjects', { timeout: 10000 }).its('response').then(response => { | ||
projects = response?.body | ||
?.sort((a, b) => a.name >= b.name ? 1 : -1) | ||
?.map(project => ({ | ||
organization: organizations.find(organization => organization.id === project.organization).label, | ||
name: project.name, | ||
description: project.description ?? '', | ||
owner: project.owner, | ||
status: project.status, | ||
locked: project.locked, | ||
createdAt: project.createdAt, | ||
updatedAt: project.updatedAt, | ||
}), | ||
) | ||
}) | ||
}) | ||
|
||
it('Should display projects table, loggedIn as admin', () => { | ||
cy.getByDataTestid('tableAdministrationProjects').within(() => { | ||
projects.forEach((project, index) => { | ||
cy.get(`tbody tr:nth-of-type(${index + 1})`).within(() => { | ||
cy.get('td:nth-of-type(1)').should('contain', project.organization) | ||
cy.get('td:nth-of-type(2)').should('contain', project.name) | ||
cy.get('td:nth-of-type(3)').should('contain', project.description) | ||
cy.get('td:nth-of-type(4)').should('contain', project.owner.email) | ||
cy.get('td:nth-of-type(5) svg title').should('contain', `Le projet ${project.name} est ${statusDict.status[project.status].wording}`) | ||
cy.get('td:nth-of-type(6) svg title').should('contain', `Le projet ${project.name} est ${statusDict.locked[!!project.locked].wording}`) | ||
cy.get('td:nth-of-type(7)').should('contain', formatDate(project.createdAt)) | ||
cy.get('td:nth-of-type(8)').should('contain', formatDate(project.updatedAt)) | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.