Skip to content

Commit

Permalink
Fixed linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
andyforrest committed Jun 19, 2023
1 parent f42b6a2 commit 4f05b4e
Showing 1 changed file with 17 additions and 26 deletions.
43 changes: 17 additions & 26 deletions tests/System/integration/site/components/com_privacy/Request.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,53 +70,44 @@ describe('Test in frontend that the privacy request view', () => {
});

it('can verify link sent to user is valid', () => {

cy.visit('/index.php?option=com_privacy&view=request');
cy.get('#jform_request_type').select('Export');
cy.get('.controls > .btn').click();


cy.task('getMails').then((mails) => {
cy.wrap(mails[0].body).should('have.string', `A new information request has been submitted by ${Cypress.env('email')}.`);
cy.wrap(mails[0].body).should('have.string', `A new information request has been submitted by ${Cypress.env('email')}.`);

let str = mails[1].body;
const str = mails[1].body;

let firstSplit = str.split('URL: ')[1];
let link = firstSplit.split('\n')[0];
const firstSplit = str.split('URL: ')[1];
const link = firstSplit.split('\n')[0];

cy.visit(link);
cy.get('.controls > .btn').click()
cy.visit(link);
cy.get('.controls > .btn').click();

cy.get('.alert-message').should('have.text', 'Your information request has been confirmed. We will process your request as soon as possible and the export will be sent to your email.')
cy.get('.alert-message').should('have.text', 'Your information request has been confirmed. We will process your request as soon as possible and the export will be sent to your email.');
});

});

it('can verify the individual link and password to copy/paste to the user is valid', () => {

cy.visit('/index.php?option=com_privacy&view=request');
cy.get('#jform_request_type').select('Export');
cy.get('.controls > .btn').click();


cy.task('getMails').then((mails) => {
const str = mails[1].body;

let str = mails[1].body;

let firstSplitURL = str.split('paste your token into the form.\n')[1];
let secondSplitURL = firstSplitURL.split('URL: ')[1]
let link = secondSplitURL.split('\n')[0];
const firstSplitURL = str.split('paste your token into the form.\n')[1];
const secondSplitURL = firstSplitURL.split('URL: ')[1];
const link = secondSplitURL.split('\n')[0];

let firstSplitToken = str.split('Token: ')[1]
let token = firstSplitToken.split('\n')[0]
const firstSplitToken = str.split('Token: ')[1];
const token = firstSplitToken.split('\n')[0];

cy.visit(link);
cy.get('#jform_confirm_token').type(token)
cy.get('.controls > .btn').click()
cy.get('.alert-message').should('have.text', 'Your information request has been confirmed. We will process your request as soon as possible and the export will be sent to your email.')
cy.visit(link);
cy.get('#jform_confirm_token').type(token);
cy.get('.controls > .btn').click();
cy.get('.alert-message').should('have.text', 'Your information request has been confirmed. We will process your request as soon as possible and the export will be sent to your email.');
});

});


});

0 comments on commit 4f05b4e

Please sign in to comment.