ember-route-action-helper
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -16,4 +16,10 @@ import Ember from 'ember'; | ||
function getCurrentHandlerInfos(router) { | ||
let routerLib = router._routerMicrolib || router.router; | ||
return routerLib.currentHandlerInfos; | ||
} | ||
function getRoutes(router) { | ||
return emberArray(router.router.currentHandlerInfos) | ||
return emberArray(getCurrentHandlerInfos(router)) | ||
.mapBy('handler') | ||
@@ -20,0 +26,0 @@ .reverse(); |
{ | ||
"name": "ember-route-action-helper", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Bubble closure actions in routes", | ||
@@ -5,0 +5,0 @@ "directories": { |
@@ -87,2 +87,31 @@ # ember-route-action-helper ![Download count all time](https://img.shields.io/npm/dt/ember-route-action-helper.svg) [![CircleCI](https://circleci.com/gh/DockYard/ember-route-action-helper.svg?style=shield)](https://circleci.com/gh/DockYard/ember-route-action-helper) [![npm version](https://badge.fury.io/js/ember-route-action-helper.svg)](https://badge.fury.io/js/ember-route-action-helper) | ||
## Overriding route-action for integration tests | ||
This helper is designed for use in controller templates, not in | ||
components. It will not, therefore, resolve route action references | ||
in an integration test. If you are using this helper in your components, | ||
you can override the helper using a pattern similar to the following: | ||
``` | ||
import { moduleForComponent, test } from 'ember-qunit'; | ||
import hbs from 'htmlbars-inline-precompile'; | ||
import Ember from 'ember'; | ||
moduleForComponent('uses-route-action', 'Integration | Component | uses route action', { | ||
integration: true, | ||
beforeEach(assert) { | ||
this.container | ||
.registry | ||
.registrations['helper:route-action'] = Ember.Helper.helper((arg) => { | ||
return this.routeActions[arg]; | ||
}); | ||
this.routeActions = { | ||
doSomething(arg) { | ||
return Ember.RSVP.resolve({arg}); | ||
}, | ||
}; | ||
}, | ||
}); | ||
``` | ||
## Building | ||
@@ -89,0 +118,0 @@ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
174185
72
129
0