next.js/test/e2e/app-dir/interception-routes-multiple-catchall/interception-routes-multiple-catchall.test.ts
interception-routes-multiple-catchall.test.ts42 lines1.7 KB
import { nextTestSetup } from 'e2e-utils'

describe('interception-routes-multiple-catchall', () => {
  const { next } = nextTestSetup({
    files: __dirname,
  })

  describe('multi-param catch-all', () => {
    it('should intercept when navigating to the same path with route interception', async () => {
      const browser = await next.browser('/templates/multi/slug')
      await browser.elementByCss("[href='/showcase/multi/slug']").click()
      await browser.waitForElementByCss('#intercepting-page')
    })

    it('should intercept when navigating to a single param path', async () => {
      const browser = await next.browser('/templates/multi/slug')
      await browser.elementByCss("[href='/showcase/single']").click()
      await browser.waitForElementByCss('#intercepting-page')
    })

    it('should intercept when navigating to a multi-param path', async () => {
      const browser = await next.browser('/templates/multi/slug')
      await browser.elementByCss("[href='/showcase/another/slug']").click()
      await browser.waitForElementByCss('#intercepting-page')
    })
  })

  describe('single param catch-all', () => {
    it('should intercept when navigating to a multi-param path', async () => {
      const browser = await next.browser('/templates/single')
      await browser.elementByCss("[href='/showcase/another/slug']").click()
      await browser.waitForElementByCss('#intercepting-page')
    })

    it('should intercept when navigating to a single param path', async () => {
      const browser = await next.browser('/templates/single')
      await browser.elementByCss("[href='/showcase/single']").click()
      await browser.waitForElementByCss('#intercepting-page')
    })
  })
})
Quest for Codev2.0.0
/
SIGN IN