next.js/test/e2e/app-dir/temporary-references/temporary-references.test.ts
temporary-references.test.ts23 lines616 B
import { nextTestSetup } from 'e2e-utils'
import { retry } from 'next-test-utils'

describe('temporary-references', () => {
  const { next } = nextTestSetup({
    files: __dirname,
  })

  it.each(['edge', 'node'])(
    'should return the same object that was sent to the action (%s)',
    async (runtime) => {
      const browser = await next.browser('/' + runtime)
      expect(await browser.elementByCss('p').text()).toBe('initial')

      await browser.elementByCss('button').click()

      await retry(async () => {
        expect(await browser.elementByCss('p').text()).toBe('identical')
      })
    }
  )
})
Quest for Codev2.0.0
/
SIGN IN