Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ module.exports = {
"@typescript-eslint/explicit-module-boundary-types": ["warn"],
},
},
{
files: ["cypress/**/*.ts"],
// Set to turn off jest linting error on cypress library
rules: {
"jest/valid-expect": "off",
},
},
],
settings: {
"import/resolver": {
Expand Down
12 changes: 12 additions & 0 deletions cypress/integration/app/settingsflow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,17 @@ describe("Settings flow", () => {
cy.get("#advanced-options").click();

cy.findByLabelText(/host expiry window/i).should("have.value", "5");

cy.getEmails().then((response) => {
expect(response.body.items[0].To[0]).to.have.property("Domain");
expect(response.body.items[0].To[0].Mailbox).to.equal("test");
expect(response.body.items[0].To[0].Domain).to.equal("fleetdm.com");
expect(response.body.items[0].From.Mailbox).to.equal("rachel");
expect(response.body.items[0].From.Domain).to.equal("fleetdm.com");
expect(response.body.items[0].Content.Headers.Subject[0]).to.equal(
"Hello from Fleet"
);
console.log(response.body.items[0]);
});
});
});
9 changes: 9 additions & 0 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,12 @@ Cypress.Commands.add("loginSSO", () => {
});
});
});

Cypress.Commands.add("getEmails", () => {
return cy
.request("http://localhost:8025/api/v2/messages")
.then((response) => {
expect(response.status).to.eq(200);
return response;
});
});
5 changes: 5 additions & 0 deletions cypress/support/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,10 @@ declare namespace Cypress {
* Custom command to login a user1@example.com via SSO.
*/
loginSSO(): Chainable<Element>;

/**
* Custom command to get the emails handled by the Mailhog server.
*/
getEmails(): Chainable<Response>;
}
}