next.js/test/e2e/app-dir/css-client-side-nav-parallel-routes/css-client-side-nav-parallel-routes.test.ts
css-client-side-nav-parallel-routes.test.ts25 lines758 B
import { nextTestSetup } from 'e2e-utils'
import { retry } from 'next-test-utils'

describe('css-client-side-nav-parallel-routes', () => {
  const { next } = nextTestSetup({
    files: __dirname,
  })

  // Recommended for tests that need a full browser
  it('should apply styles after navigation', async () => {
    const browser = await next.browser('/source')
    await browser.elementByCss('a').click()

    // transition might not be instant so we wrap in retry
    retry(async () => {
      expect(
        await browser.elementByCss('#global').getComputedCss('background-color')
      ).toBe('rgb(0, 255, 0)')
      expect(
        await browser.elementByCss('#module').getComputedCss('background-color')
      ).toBe('rgb(0, 255, 0)')
    })
  })
})
Quest for Codev2.0.0
/
SIGN IN