Skip to content

Commit

Permalink
Merge branch 'development' into DES/enhancement/#732-vlc-refactor
Browse files Browse the repository at this point in the history
# Conflicts:
#	cypress/integration/unit/formally-ok.spec.js
  • Loading branch information
brenner-company committed Apr 30, 2021
2 parents 0cd78a4 + b7a4234 commit 7fac076
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 38 deletions.
7 changes: 5 additions & 2 deletions app/components/web-components/vl-modal-footer.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
<WebComponents::AuToolbar::Item>
<WebComponents::AuButton
@skin="primary"
disabled={{disableSave}}
{{!-- also disable button when 'isLoading', since no loading state on button is available.
Disabling the button while in loading state is important in order to avoid multiple
action calls when clicking multiple times on the same confirm-button --}}
disabled={{or this.disableSave this.isLoading}}
{{!-- loadingText=(t "please-be-patient")
isLoading=isLoading --}}
data-test-vl-save={{true}}
Expand All @@ -21,4 +24,4 @@
</WebComponents::AuButton>
</WebComponents::AuToolbar::Item>
</WebComponents::AuToolbar::Group>
</WebComponents::AuToolbar>
</WebComponents::AuToolbar>
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export default class DocumentsAgendaitemsAgendaController extends Controller {
agendaActivity,
pieces,
});
submissionActivity.save();
submissionActivity.save(); // submission-act isn't needed further here. No yield. Can run in background.
}

// Link piece to agendaitem
Expand Down
32 changes: 0 additions & 32 deletions cypress/integration/unit/file-upload.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,6 @@ context('Add files to an agenda', () => { // At the meeting-level
folder: 'files', fileName: 'test', fileExtension: 'pdf', newFileName: 'test pdf', fileType: 'Nota',
}], 'meeting');

// Click save
// cy.route('POST', 'pieces').as('createNewPiece');
// cy.route('POST', 'document-containers').as('createNewDocumentContainer');
// cy.route('GET', '/pieces?filter\\[meeting\\]\\[:id:\\]=*').as('loadPieces');
// cy.get('@fileUploadDialog').within(() => {
// cy.get('.auk-button').contains('Documenten toevoegen')
// .click();
// });
// cy.wait('@createNewDocumentContainer', {
// timeout: 24000,
// });
// cy.wait('@createNewPiece', {
// timeout: 24000,
// });
// cy.wait('@loadPieces');

// Check the name of the document we just uploaded
cy.get('.vlc-scroll-wrapper__body > .auk-u-m-8').within(() => { // TODO: selectors need improvement
cy.get(document.documentCard).eq(0)
Expand Down Expand Up @@ -115,22 +99,6 @@ context('Add files to an agenda', () => { // At the meeting-level
], 'meeting'
);

// Click save
// cy.route('POST', 'pieces').as('createNewPiece');
// cy.route('POST', 'document-containers').as('createNewDocumentContainer');
// cy.route('GET', '/pieces?filter\\[meeting\\]\\[:id:\\]=*').as('loadPieces');
// cy.get('@fileUploadDialog').within(() => {
// cy.get('.auk-button').contains('Documenten toevoegen')
// .click();
// });
// cy.wait('@createNewDocumentContainer', {
// timeout: 24000,
// });
// cy.wait('@createNewPiece', {
// timeout: 24000,
// });
// cy.wait('@loadPieces');

// Test if documents are listed in the correct sorting order
cy.get('.vlc-scroll-wrapper__body > .auk-u-m-8').within(() => { // TODO: selectors need improvement
cy.get(document.documentCard).as('docCards');
Expand Down
2 changes: 2 additions & 0 deletions cypress/integration/unit/formally-ok.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ context('Formally ok/nok tests', () => {
// This test could be replaced by checking that approved agenda is not showing formal ok's in existing testdata
it('should not show "formallyOk" status of agendaitems on approved agenda', () => {
cy.visit('/vergadering/5EBAB9B1BDF1690009000001/agenda/1d4f8091-51cf-4d3c-b776-1c07cc263e59/agendapunten');
// TODO this first part of the test could belong in meeting-actions.spec
cy.get('.vlc-agenda-items__sub-item').should('have.length', 1);
cy.get('.vlc-agenda-items__status').should('contain', 'Formeel OK');
cy.setFormalOkOnItemWithIndex(0, true, 'Nog niet formeel OK');
Expand All @@ -27,6 +28,7 @@ context('Formally ok/nok tests', () => {
cy.get(modal.auModal.cancel).click();
cy.setFormalOkOnItemWithIndex(0, true, 'Formeel OK');
cy.get('.auk-sidebar__item').as('agendas');
// Testing on approved agenda the formally ok status should not show
cy.get('@agendas').eq(1)
.click();
cy.wait(2000); // Make sure the formally ok can load (false positive if testing immediately)
Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/unit/meeting-actions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ context('meeting actions tests', () => {
it('should not be able to delete approved agendaitem from designagenda with profile: Kanselarij', () => {
const SubcaseTitleShort = 'Cypress test: delete approve agenda Kanselarij - 1588775768';
cy.login('Kanselarij');
cy.visitAgendaWithLink('/vergadering/5EB2CB8FF5E126000900000D/agenda/5EB2CB91F5E126000900000E/agendapunten');
cy.changeSelectedAgenda('Ontwerpagenda');
cy.visitAgendaWithLink('/vergadering/5EB2CB8FF5E126000900000D/agenda/cd6b8ae7-0f00-451c-b4ad-fa236d5e6a20/agendapunten');

cy.openDetailOfAgendaitem(SubcaseTitleShort);
cy.get(agenda.agendaitemControlsActions).click();
Expand Down Expand Up @@ -99,10 +98,11 @@ context('meeting actions tests', () => {
cy.wait('@patchSubcase', {
timeout: 12000,
});
// TODO this is no longer a vl modal? cypress test does not wait while loading modal is still present
cy.get(modal.modal).should('not.be.visible');

// Verify subcase is no longer on designagenda after deleting the agendaitem
cy.changeSelectedAgenda('Agenda A');
cy.changeSelectedAgenda('Ontwerpagenda');
cy.clickReverseTab('Overzicht');
cy.wait(1000);
cy.get('li.vlc-agenda-items__sub-item h4')
Expand Down
2 changes: 2 additions & 0 deletions cypress/integration/unit/meeting-overviews.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ context('Test print overviews', () => {
cy.logout();
});

// TODO assert something? also use the actions from the actions menu from agenda to ensure both visit and action go to the same place?

it('should visit beslissingen print overview', () => {
cy.visit(beslissingen);
cy.wait(1500);
Expand Down
9 changes: 9 additions & 0 deletions cypress/integration/unit/newsletter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ context('Test the KB functionality', () => {
cy.logout();
});

// TODO spec newsletterInfo/shouldtestFullWarningFlowOnKB has similar setup and tests the agendaitem part of the NOTA bis updates
// TODO does that test belong in this spec file instead?

it('should test the newsletter of an agenda', () => {
// TODO, this setup contains some unneeded details like mandatees, which are not checked further on
const testId = `testId=${currentTimestamp()}: `;
const agendaDate = Cypress.moment().add(2, 'weeks')
.day(3); // Next friday
Expand All @@ -42,6 +46,7 @@ context('Test the KB functionality', () => {
cy.addSubcase(type1, newSubcase1TitleShort, subcase1TitleLong, subcase1Type, subcase1Name);
cy.openSubcase(0);

// TODO these next 2 lines do not matter for this test
cy.changeSubcaseAccessLevel(false, case1TitleShort, true, 'Intern Overheid');
cy.addSubcaseMandatee(0, 0, 0);

Expand All @@ -65,13 +70,15 @@ context('Test the KB functionality', () => {

cy.addSubcase(type2, newSubcase2TitleShort, subcase2TitleLong, subcase2Type, subcase2Name);
cy.openSubcase(0);
// TODO these next 3 lines do not matter for this test
cy.changeSubcaseAccessLevel(false, newSubcase2TitleShort, false, 'Intern Overheid');
cy.addSubcaseMandatee(1, 0, 0);
cy.addSubcaseMandatee(2, 0, 0);
cy.addDocumentsToSubcase([{
folder: 'files', fileName: 'test', fileExtension: 'pdf', newFileName: 'Document dossier 2', fileType: 'Nota',
}]);

// TODO why wait ?
cy.wait(3000);

cy.createAgenda('Ministerraad', agendaDate, 'Test Kort bestek toevoegen').then((result) => {
Expand All @@ -80,12 +87,14 @@ context('Test the KB functionality', () => {
cy.addAgendaitemToAgenda(case1TitleShort, false);
cy.addAgendaitemToAgenda(case2TitleShort, false);

// TODO does formally ok status matter for this test ?
cy.setFormalOkOnItemWithIndex(0);
cy.setFormalOkOnItemWithIndex(1);
cy.setFormalOkOnItemWithIndex(2);

// TODO this route is flaky, check why, used general wait instead
// cy.route('/document-containers?**').as('getDocumentContainerOfPieces');
// TODO use visit or action in agenda? visit is faster but then why not visit ".../nota-updates"
cy.visit(`/vergadering/${result.meetingId}/kort-bestek`);
cy.get(newsletter.notaUpdates).click();
cy.wait(2000);
Expand Down

0 comments on commit 7fac076

Please sign in to comment.