Skip to content
This repository was archived by the owner on Mar 5, 2022. It is now read-only.

Commit 0cbcd9a

Browse files
committed
chore: increase time out
1 parent 5aed985 commit 0cbcd9a

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

cypress/integration/users-spec.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/// <reference types="cypress" />
12
import { Users } from '../../src/users.jsx'
23
import React from 'react'
34

@@ -6,7 +7,8 @@ context('Users', () => {
67
describe('Component', () => {
78
it('fetches 3 users from remote API', () => {
89
cy.mount(<Users />)
9-
cy.get('li').should('have.length', 3)
10+
// fetching users can take a while
11+
cy.get('li', { timeout: 20000 }).should('have.length', 3)
1012
})
1113
})
1214

@@ -17,30 +19,35 @@ context('Users', () => {
1719
// preventing race conditions where you wait on untouched routes
1820
})
1921

20-
2122
it('can inspect real data in XHR', () => {
2223
cy.route('/users?_limit=3').as('users')
2324
cy.mount(<Users />)
24-
cy.wait('@users').its('response.body').should('have.length', 3)
25+
cy.wait('@users')
26+
.its('response.body')
27+
.should('have.length', 3)
2528
})
2629

2730
it('can display mock XHR response', () => {
28-
const users = [{id: 1, name: 'foo'}]
31+
const users = [{ id: 1, name: 'foo' }]
2932
cy.route('GET', '/users?_limit=3', users).as('users')
3033
cy.mount(<Users />)
31-
cy.get('li').should('have.length', 1)
32-
.first().contains('foo')
34+
cy.get('li')
35+
.should('have.length', 1)
36+
.first()
37+
.contains('foo')
3338
})
3439

3540
it('can inspect mocked XHR', () => {
36-
const users = [{id: 1, name: 'foo'}]
41+
const users = [{ id: 1, name: 'foo' }]
3742
cy.route('GET', '/users?_limit=3', users).as('users')
3843
cy.mount(<Users />)
39-
cy.wait('@users').its('response.body').should('deep.equal', users)
44+
cy.wait('@users')
45+
.its('response.body')
46+
.should('deep.equal', users)
4047
})
4148

4249
it('can delay and wait on XHR', () => {
43-
const users = [{id: 1, name: 'foo'}]
50+
const users = [{ id: 1, name: 'foo' }]
4451
cy.route({
4552
method: 'GET',
4653
url: '/users?_limit=3',

0 commit comments

Comments
 (0)