scottohara / loot

An implementation of some of the core MS Money features in Ruby on Rails
MIT License
4 stars 3 forks source link

Extra $timeout.flush() required in ScheduleEditController specs #119

Closed scottohara closed 7 years ago

scottohara commented 7 years ago

An extra call to $timeout.flush() is required in the ScheduleEditController specs, due to a bug in angular where $timeout.verifyNoPendingTasks() is detecting pending tasks that are not related to $timeout.

The problem is triggered by a rejected promise being created in ui.router.state.$state.$get() (to handle TransitionSuperseded errors (https://github.com/angular-ui/ui-router/issues/3365). The ui.router maintainer will welcome a PR to generate the rejections on the fly instead of creating them in advance.

But the core issue really is the angular bug, so I'm inclined to wait for that to be resolved.