describe ( 'Server side rendering' , ( ) => { const indexUrl = '/' ; it ( 'should make concurrent requests and app should render correctly for each request' , async ( ) => { const promises = Array . from ( { length : 100 } ) . map ( ( ) => fetch ( '/' ) . then ( res => res . text ( ) ) ) ; const bodies = await Promise . all ( promises ) ; bodies . forEach ( body => { expect ( body ) . to . contain ( 'Toggle counter component' ) ; } ) ; } ) ; it ( 'successfully render index page' , ( ) => { cy . request ( indexUrl ) . its ( 'body' ) . should ( 'contain' , 'Counter is 0' ) ; } ) ; it ( 'should increment and decrement after button clicks' , ( ) => { cy . visit ( indexUrl ) . get ( 'button.increment' ) . click ( ) . click ( ) . click ( ) . click ( ) . click ( ) . get ( 'button.decrement' ) . click ( ) . click ( ) . click ( ) . get ( 'h1.counter' ) . should ( 'contain' , 'Counter is 2' ) ; } ) ; it ( 'should increment but cancel previously uncompleted async job' , ( ) => { cy . visit ( indexUrl ) . get ( 'button.increment-async' ) . click ( ) . click ( ) . click ( ) . wait ( 600 ) . get ( 'h1.counter' ) . should ( 'contain' , 'Counter is 1' ) ; } ) ; } ) ;