Skip to content

Commit d3808c2

Browse files
committed
Merge branch 'develop'
2 parents e8c73c7 + 5e7ad51 commit d3808c2

22 files changed

Lines changed: 1384 additions & 1177 deletions

File tree

frontend_tests/cypress/e2e/project/multiportail/canViewProjectShareBetweenPortal.cy.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ describe('Project share between portal', () => {
2020
.should('include.text', 'example2');
2121
});
2222

23+
it('display share by and with portal on list advisor dashboard', () => {
24+
cy.visit('/projects/advisor');
25+
cy.get('[data-cy="list-project-shared-by-origin"]')
26+
.should('be.visible')
27+
.should('include.text', 'example2');
28+
});
29+
30+
2331
it('display current portal EDL first', () => {
2432
cy.visit('/project/23/connaissance');
2533

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import editor from '../../../support/tools/editor';
2+
import file from '../../../fixtures/documents/file.json';
3+
const currentProjectId = 25;
4+
5+
describe('I can access tabs and see notifications', () => {
6+
before(() => {
7+
cy.login('collectivité1');
8+
cy.visit(`/project/${currentProjectId}/presentation`);
9+
cy.get('[data-test-id="badge-tab-new-task"]').should('not.exist');
10+
cy.get('[data-test-id="badge-tab-new-message"]').should('not.exist');
11+
cy.get('[data-test-id="badge-tab-new-file"]').should('not.exist');
12+
cy.logout();
13+
14+
cy.login('conseiller1');
15+
// Create a task to have a notification
16+
cy.visit(`/project/${currentProjectId}/actions`);
17+
cy.createTask('Tâche notification');
18+
19+
// Create message to have a notification
20+
cy.visit(`/project/${currentProjectId}/conversations`);
21+
const now = new Date();
22+
23+
cy.get('textarea')
24+
.type(`test : ${now}`, { force: true })
25+
.should('have.value', `test : ${now}`);
26+
27+
editor.writeMessage(`test : ${now}`);
28+
cy.contains('Envoyer').click({ force: true });
29+
cy.contains(`test : ${now}`);
30+
31+
// Post a file to have a notification
32+
cy.visit(`/project/${currentProjectId}/documents`);
33+
34+
cy.document().then((doc) => {
35+
var popover = doc.getElementById('popover');
36+
popover.style = 'display:block !important;';
37+
38+
cy.get('[name="the_file"]').selectFile(file.path, { force: true });
39+
cy.get('#document-description')
40+
.type(file.description, { force: true, delay: 0 })
41+
.should('have.value', file.description);
42+
cy.get('#document-submit-button').click({ force: true });
43+
});
44+
45+
cy.contains('Le document a bien été enregistré');
46+
cy.logout();
47+
});
48+
49+
it('goes to the action page of my project', () => {
50+
cy.login('collectivité1');
51+
cy.visit(`/project/25/presentation`);
52+
cy.get('[data-test-id="badge-tab-new-task"]').should('exist');
53+
cy.get('[data-test-id="badge-tab-new-message"]').should('exist');
54+
cy.get('[data-test-id="badge-tab-new-file"]').should('exist');
55+
});
56+
});

frontend_tests/cypress/fixtures/projects/projects.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,5 +661,32 @@
661661
"impediments": "",
662662
"deleted": null
663663
}
664+
},
665+
{
666+
"model": "projects.project",
667+
"pk": 25,
668+
"fields": {
669+
"submitted_by": 5,
670+
"ro_key": "2d0eea4146c142a4980877f13c44fc02",
671+
"last_name": "Jean-Pierre",
672+
"first_name": "Lepécheur",
673+
"publish_to_cartofriches": false,
674+
"exclude_stats": true,
675+
"muted": false,
676+
"org_name": "Frichti",
677+
"created_on": "2024-12-10T14:31:39Z",
678+
"updated_on": "2024-12-10T13:08:07.795Z",
679+
"tags": "",
680+
"name": "Projet test notifications",
681+
"phone": "01 01 01 01 01",
682+
"description": "Projet test notifications",
683+
"advisors_note": "Quels financements existent pour ouvrir une friterie traditionnelle mais dans un food truck, le tout sur une ancienne usine de draperie ?\r\nedit de PR@beta",
684+
"advisors_note_on": "2024-12-10T14:51:12Z",
685+
"advisors_note_by": 5,
686+
"location": "861 chemin rural 53",
687+
"commune": 42,
688+
"impediments": "",
689+
"deleted": null
690+
}
664691
}
665692
]

0 commit comments

Comments
 (0)