Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

MemoryRouter does not provide onRoute context #221

Open
aliaksandr-kazarez opened this issue Jan 28, 2019 · 1 comment
Open

MemoryRouter does not provide onRoute context #221

aliaksandr-kazarez opened this issue Jan 28, 2019 · 1 comment

Comments

@aliaksandr-kazarez
Copy link

Type of issue

Bug

Description

MemoryRouter does not provide onRoute into child context
Besides it would be nice to be able to override onRoute with some mock function

Current behavior

When using MemoryRouter for UnitTesting it fails with following error:
TypeError: context.onRoute is not a function

Expected behavior

Should not fails on this step

Steps to reproduce

run following test snippet:

    const component = mount(
      <MemoryRouter initialEntries={['/test']}>
        <Route path="/test" render={() => <div>Test</div>} />
      </MemoryRouter>
    );

    expect(component.find('div').text()).toBe('Test');

Your environment

  • fusion-plugin-react-router version: 1.2.0

  • Node.js version (node --version): 8.14

  • npm version (npm --version): 6.4.1

  • Operating System: OSX

@lhorie
Copy link
Contributor

lhorie commented Feb 20, 2019

Fixed by #232

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants