Compare View
Commits (2)
Showing
2 changed files
Show diff stats
src/app/search/search-form/search-form.component.spec.ts
... | ... | @@ -8,7 +8,7 @@ describe("Components", () => { |
8 | 8 | describe("Search Form Component", () => { |
9 | 9 | |
10 | 10 | let helper: ComponentTestHelper<SearchFormComponent>; |
11 | - let stateMock = jasmine.createSpyObj("$state", ["go"]); | |
11 | + let stateMock = jasmine.createSpyObj("$state", ["go", "params", "current"]); | |
12 | 12 | |
13 | 13 | beforeEach(angular.mock.module("templates")); |
14 | 14 | ... | ... |
src/app/search/search.component.spec.ts
... | ... | @@ -12,6 +12,7 @@ describe("Components", () => { |
12 | 12 | let articleService = jasmine.createSpyObj("ArticleService", ["search"]); |
13 | 13 | let result = Promise.resolve({ data: [{ id: 1 }], headers: (param: string) => { return 1; } }); |
14 | 14 | articleService.search = jasmine.createSpy("search").and.returnValue(result); |
15 | + let stateMock = jasmine.createSpyObj("$state", ["go"]); | |
15 | 16 | |
16 | 17 | beforeEach(angular.mock.module("templates")); |
17 | 18 | |
... | ... | @@ -21,7 +22,8 @@ describe("Components", () => { |
21 | 22 | directives: [SearchComponent], |
22 | 23 | providers: [ |
23 | 24 | helpers.createProviderToValue("$stateParams", stateParams), |
24 | - helpers.createProviderToValue("ArticleService", articleService) | |
25 | + helpers.createProviderToValue("ArticleService", articleService), | |
26 | + helpers.createProviderToValue("$state", stateMock), | |
25 | 27 | ].concat(helpers.provideFilters("truncateFilter", "stripTagsFilter")) |
26 | 28 | }); |
27 | 29 | helper = new ComponentTestHelper<SearchComponent>(cls, done); | ... | ... |