From 20e8fa38d214b7d949e68d7a792070b634d6ad08 Mon Sep 17 00:00:00 2001 From: Abner Oliveira Date: Tue, 15 Mar 2016 23:00:28 -0300 Subject: [PATCH] fixed tests after merge with ngforward branch --- src/app/cms/cms.component.ts | 5 +++-- src/app/content-viewer/content-viewer.component.spec.ts | 12 +++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/app/cms/cms.component.ts b/src/app/cms/cms.component.ts index d489290..d2fe9e5 100644 --- a/src/app/cms/cms.component.ts +++ b/src/app/cms/cms.component.ts @@ -26,8 +26,9 @@ export class Cms { save() { this.profileService.getCurrentProfile().then((profile: noosfero.Profile) => { return this.articleService.create(this.article, profile); - }).then((response: restangular.IResponse) => { - this.$state.transitionTo('main.profile.page', { page: response.data.article.path, profile: response.data.article.profile.identifier }); + }).then((response: noosfero.RestResult) => { + let article = (response.data); + this.$state.transitionTo('main.profile.page', { page: article.path, profile: article.profile.identifier }); this.notification.success("Good job!", "Article saved!"); }); } diff --git a/src/app/content-viewer/content-viewer.component.spec.ts b/src/app/content-viewer/content-viewer.component.spec.ts index 92abc37..e891d4f 100644 --- a/src/app/content-viewer/content-viewer.component.spec.ts +++ b/src/app/content-viewer/content-viewer.component.spec.ts @@ -55,11 +55,11 @@ describe('Content Viewer Component', () => { }); it('check if article was loaded', (done: Function) => { - var article: any = { + let article: any = { id: 1, title: 'The article test' }; - var profile: any = { + let profile: any = { id: 1, identifier: 'the-profile-test', type: 'Person' @@ -71,9 +71,7 @@ describe('Content Viewer Component', () => { helpers.mocks.articleService.getByProfile = (id: number, params: any) => { return helpers.mocks.promiseResultTemplate({ - data: { - article: article - } + data: article }); }; @@ -81,8 +79,8 @@ describe('Content Viewer Component', () => { buildComponent().then((fixture: ComponentFixture) => { let contentViewerComp: ContentViewer = fixture.debugElement.componentViewChildren[0].componentInstance; - expect(contentViewerComp.profile).toEqual(jasmine.objectContaining(profile)); - expect(contentViewerComp.article).toEqual(jasmine.objectContaining(article)); + expect(contentViewerComp.profile).toEqual(profile); + expect(contentViewerComp.article).toEqual(article); done(); }); -- libgit2 0.21.2