next.js/test/e2e/app-dir/app-catch-all-optional/app-catch-all-optional.test.ts
app-catch-all-optional.test.ts22 lines707 B
import { nextTestSetup } from 'e2e-utils'

describe('app-catch-all-optional', () => {
  const { next } = nextTestSetup({
    files: __dirname,
  })

  it('should handle optional catchall', async () => {
    let $ = await next.render$('/en/flags/the/rest')
    expect($('body [data-lang]').text()).toBe('en')
    expect($('body [data-flags]').text()).toBe('flags')
    expect($('body [data-rest]').text()).toBe('the/rest')
  })

  it('should handle optional catchall with no params', async () => {
    let $ = await next.render$('/en/flags')
    expect($('body [data-lang]').text()).toBe('en')
    expect($('body [data-flags]').text()).toBe('flags')
    expect($('body [data-rest]').text()).toBe('')
  })
})
Quest for Codev2.0.0
/
SIGN IN