<commit_before>// @flow
import React from 'react'
import { createRouter, mountInProvider } from '../testUtil'
import Outlet from './Outlet'

describe('Outlet', () => {
  let router

  beforeEach(() => {
    router = createRouter(
      [
        {
          path: '',
          data: { component: RootPage },
          children: [
            { path: '', match: 'full', data: { component: HomePage } },
            {
              path: 'about',
              data: { component: AboutPage },
              children: [{ path: 'contact', data: { component: ContactPage } }]
            },
            {
              path: 'posts',
              children: [
                { path: '', data: { component: PostListPage } },
                { path: ':id', data: { component: PostViewPage } }
              ]
            }
          ]
        }
      ],
      '/'
    )
    return router.start()
  })

  afterEach(() => {
    router.stop()
  })

  test('Renders', () => {
    const wrapper = mountInProvider(router)(<Outlet />)
    expect(wrapper.html()).toMatch(/RootPage/)
  })

  test('Supports nested routes', async () => {
    await router.push('/about/contact')
    const wrapper = mountInProvider(router)(<Outlet />)
    expect(wrapper.html()).toMatch(/RootPage/)
    expect(wrapper.html()).toMatch(/AboutPage/)
    expect(wrapper.html()).toMatch(/ContactPage/)
  })
})
<commit_msg>Extends Outlet test<commit_after>// @flow
import React from 'react'
import { createRouter, mountInProvider } from '../testUtil'
import Outlet from './Outlet'

describe('Outlet', () => {
  let router

  beforeEach(() => {
    router = createRouter(
      [
        {
          path: '',
          data: { component: RootPage },
          children: [
            { path: '', match: 'full', data: { component: HomePage } },
            {
              path: 'about',
              data: { component: AboutPage },
              children: [{ path: 'contact', data: { component: ContactPage } }]
            },
            {
              path: 'posts',
              children: [
                { path: '', data: { component: PostListPage } },
                { path: ':id', data: { component: PostViewPage } }
              ]
            }
          ]
        }
      ],
      '/'
    )
    return router.start()
  })

  afterEach(() => {
    router.stop()
  })

  test('Renders', () => {
    const wrapper = mountInProvider(router)(<Outlet />)
    expect(wrapper.html()).toMatch(/RootPage/)
    expect(wrapper.html()).toMatch(/HomePage/)
  })

  test('Supports nested routes', async () => {
    await router.push('/about/contact')
    const wrapper = mountInProvider(router)(<Outlet />)
    expect(wrapper.html()).toMatch(/RootPage/)
    expect(wrapper.html()).toMatch(/AboutPage/)
    expect(wrapper.html()).toMatch(/ContactPage/)
  })
})

{'fraction_non_alphanumeric': 0.16802552286423253, 'fraction_numerical': 0.0, 'mean_word_length': 1.8678861788617886, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2652235', 'n_tokens_mistral': 809, 'n_tokens_neox': 794, 'n_words': 155}