Skip to content

Commit

Permalink
Fix broken Cypress UI tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Dec 9, 2021
1 parent 4cb5eb7 commit 02c1408
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion frontend/cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
"serverInitCmd": "pkill -9 listmonk | cd ../ && ./listmonk --install --yes && ./listmonk > /dev/null 2>/dev/null &",
"username": "listmonk",
"password": "listmonk"
}
},
"viewportWidth": 1300,
"viewportHeight": 950
}
6 changes: 6 additions & 0 deletions frontend/cypress/integration/campaigns.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ describe('Campaigns', () => {
cy.get('button[data-cy=btn-preview]').click();
cy.wait(200);
cy.get("#iframe").then(($f) => {
if (c === 'plain') {
return;
}
const doc = $f.contents();
expect(doc.find('.wrap').text().trim().replace(/(\s|\n)+/, ' ')).equal(plainBody);
});
Expand Down Expand Up @@ -216,6 +219,9 @@ describe('Campaigns', () => {
cy.get('button[data-cy=btn-preview]').click();
cy.wait(200);
cy.get("#iframe").then(($f) => {
if (c === 'plain') {
return;
}
const doc = $f.contents();
expect(doc.find('.wrap').text().trim()).equal(plainBody);
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/cypress/integration/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('Dashboard', () => {

// Campaign counts.
cy.get('[data-cy=campaigns] .title').contains('1');
cy.get('[data-cy=campaigns]').contains('1 draft');
cy.get('[data-cy=campaigns-draft]').contains('1');

// Subscriber counts.
cy.get('[data-cy=subscribers] .title').contains('2');
Expand Down

0 comments on commit 02c1408

Please sign in to comment.