Skip to content

Commit

Permalink
Add tests for events
Browse files Browse the repository at this point in the history
  • Loading branch information
mpourismaiel committed Dec 16, 2019
1 parent 9747f5e commit 9a4d868
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions cypress/integration/events.js
@@ -0,0 +1,29 @@
describe("Events", () => {
beforeEach(() => {
cy.visit("/dev/events/payment//");
});

it("should focus stripe form when stripe event is fired", () => {
cy.get(
"a[href='/dev/events/payment?event=pricing:change&product=Starting%20plan&price=$9.99/mo&currency=usd']"
).click();
cy.get("#stripe input[name=email]").should("focused", true);
cy.get("#stripe .price-display .btn-group label")
.should("have.length", 1)
.should("contain", "$9.99/mo");
});

it("should focus contact form when contact event is fired", () => {
cy.get(
"a[href='/dev/events/payment?e=P2V2ZW50PWNvbnRhY3Q6dXBkYXRlJm1lc3NhZ2U9VGl0bGU6IExldCdzIG5lZ290aWF0ZQpQbGFuOiBFbnRlcnByaXNlIHBsYW4KWW91ciBtZXNzYWdlOgo=']"
).click();
cy.get("#contact input[name=name]").should("focused", true);
cy.get("#contact textarea[name=message]").should(
"contain",
`Title: Let's negotiate
Plan: Enterprise plan
Your message:
`
);
});
});

0 comments on commit 9a4d868

Please sign in to comment.