I have integration tests that get passed a state service, and it's a bit of a pain to set up because of the requirement to pass a string to the stateFor method.
For instance, I have a component x-foo and it renders x-bar in its template. Since x-foo creates the state object, x-bar gets passed the state component. In tests/integration/component/x-bar-test.js, I have to create the state service like this:
beforeEach(function() {
const obj = Ember.Object.extend({
initialStateObject: Ember.computed(function(){
... logic ...
}),
state: state('state', 'initialStateObject')
}).create();
this.set('stateObj', obj.get('state'));
});
it('does something', function() {
this.render(hbs`{{x-bar stateObj=stateObj}}`);
... assertations ...
});