bahmutov / todo-graphql-example

Example Todo app on top of json-graphql-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to preserve mocked fetch during window reload?

bahmutov opened this issue · comments

it.skip('shows new item after reload', () => {
  cy.get('.todo-list li').should('have.length', 2)
  cy.get('.new-todo').type('new todo{enter}')

  cy.get('.todo-list li')
    .should('have.length', 3)
    .contains('new todo')

  // currently deletes the window.fetch mock
  cy.reload()
})

this "loses" the stubbed fetch, and breaks in-memory json-server load

done in #13