ergo / polymer-ui-router

UI-router wrapper for Web Components
Apache License 2.0
22 stars 6 forks source link

States do not seem to update #13

Open zakkudo opened 6 years ago

zakkudo commented 6 years ago

I'm trying to write some tests for a wrapper I made for polymer-ui-router to make it more stateless. Between the tests in karma, it looks like the library is just adding routes instead of overwriting them. (I get an error that the home route still exists for example.)

Is this known functionality? Should I write a repro?

zakkudo commented 6 years ago

One other note is the library doesn't seem to set itself up until uirouter-router is appended to the document body which makes unit testing in isolation a bit more difficult.

ergo commented 6 years ago

Hi, you can start the router manually via start(), would that solve your issue? I would love some help with PR's that would improve testing situation.

zakkudo commented 6 years ago

Night... I am also open to doing pull requests. Thanks for the quick reply!

ergo commented 6 years ago

Awesome, can you share your wrapper work? As far as I can tell UI Router creates a global instance, https://ui-router.github.io/core/docs/latest/ - I skimmed at the docs and found https://ui-router.github.io/core/docs/latest/classes/state.stateregistry.html#deregister - would that work for you to clear out the states?