Skip to content

Commit

Permalink
Add "add to Mealplan" cypress test
Browse files Browse the repository at this point in the history
  • Loading branch information
incredible-elk committed Aug 10, 2020
1 parent d02f92d commit f77e5b4
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions cypress/integration/addToMealplan.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
describe('Add and remove recipe to Mealplan', () => {
it('Adds recipe to Mealplan ', () => {
cy.visit('/recipes');

cy.get('#recipes li:eq(3) a').click();
cy.get('[data-testid="add-to-mealplan"]').click();

cy.visit('/');
cy.get('#meals li').eq(0);
cy.get('#meals li:eq(0) input[type=text]').should(
'have.value',
'Banoffee Pie'
);
});

it('Removes recipe from Mealplan', () => {
cy.visit('/');

cy.visit('/recipes');
cy.get('#recipes li:eq(4) a').click();
cy.get('[data-testid="add-to-mealplan"]').click();

cy.visit('/recipes');

cy.get('#recipes li:eq(3) a').click();
cy.get('[data-testid="add-to-mealplan"]').click();

cy.get('[data-testid="add-to-mealplan"]').click();

cy.visit('/');
cy.get('#meals li:eq(0) input[type=text]').should(
'not.have.value',
'Banoffee Pie'
);
});
});

0 comments on commit f77e5b4

Please sign in to comment.