Skip to content

Instantly share code, notes, and snippets.

@hypeJunction
Last active January 24, 2021 18:30
Show Gist options
  • Save hypeJunction/028892eb651b215f07ff9b7955c1d1f0 to your computer and use it in GitHub Desktop.
Save hypeJunction/028892eb651b215f07ff9b7955c1d1f0 to your computer and use it in GitHub Desktop.
context('To Do Items', () => {
it('Should display a list of to do items', () => {
cy.intercept({
method: 'GET',
url: new RegExp(`${REACT_APP_TODO_API_URL}/v1/to-dos`)
}, {
fixture: 'todos.json`
}).as('loadToDos');
cy.visit('/');
cy.findByText('To-Do Items').click();
cy.wait('@loadToDos');
cy.findByText('Buy coffee').should('exist');
cy.findByText('Pay rent').should('exist');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment