-
-
Save gdyrrahitis/699b8cd5d262ed09669d9bc94199ce3c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let createComponent: (name: string, locals: any, bindings: any) => any; | |
let $state: ng.ui.IStateService; | |
beforeEach(inject((_$componentController_: ng.IComponentControllerService, _$state_) => { | |
createComponent = (name, locals, bindings) => _$componentController_(name, locals, bindings); | |
$state = _$state_; | |
})); | |
it("should navigate to /todo:id", () => { | |
// arrange | |
spyOn($state, "go"); | |
let component = createComponent("todoHome", null, {}); | |
// act | |
component.showTodo("1"); | |
// assert | |
expect($state.go).toHaveBeenCalledWith("todo", { id: "1" }); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment