diff --git a/src/app/profile/activities/activity/activity.component.spec.ts b/src/app/profile/activities/activity/activity.component.spec.ts index ed6f98c..1daa5b3 100644 --- a/src/app/profile/activities/activity/activity.component.spec.ts +++ b/src/app/profile/activities/activity/activity.component.spec.ts @@ -12,6 +12,7 @@ const htmlTemplate: string = ' { describe("Noosfero Activity", () => { + let activity = { name: "activity1", verb: "create_article" }; beforeEach(angular.mock.module("templates")); @@ -21,18 +22,54 @@ describe("Components", () => { directives: [ActivityComponent], providers: provideFilters("truncateFilter", "stripTagsFilter", "translateFilter") }) + class BlockContainerComponent { - activity = { name: "activity1", verb: "create_article" }; + activity = activity; } it("render the specific template for an activity verb", done => { tcb.createAsync(BlockContainerComponent).then(fixture => { let component: ActivityComponent = fixture.debugElement.componentViewChildren[0].componentInstance; expect(component.getActivityTemplate()).toEqual('app/profile/activities/activity/create_article.html'); + done(); + }); + }); + + it("render create article template correctly", done => { + activity = { name: "activity1", verb: "create_article" }; + tcb.createAsync(BlockContainerComponent).then(fixture => { + let component: ActivityComponent = fixture.debugElement.componentViewChildren[0].componentInstance; expect(fixture.debugElement.queryAll(".activity.create_article").length).toEqual(1); done(); }); }); + + it("render add_member_in_community template correctly", done => { + activity = { name: "add_member_in_community1", verb: "add_member_in_community" }; + tcb.createAsync(BlockContainerComponent).then(fixture => { + let component: ActivityComponent = fixture.debugElement.componentViewChildren[0].componentInstance; + expect(fixture.debugElement.queryAll(".activity.add_member_in_community").length).toEqual(1); + done(); + }); + }); + + it("render new_friendship template correctly", done => { + activity = { name: "new_friendship1", verb: "new_friendship" }; + tcb.createAsync(BlockContainerComponent).then(fixture => { + let component: ActivityComponent = fixture.debugElement.componentViewChildren[0].componentInstance; + expect(fixture.debugElement.queryAll(".activity.new_friendship").length).toEqual(1); + done(); + }); + }); + + it("render scrap template correctly", done => { + activity = { name: "scrap1", verb: "scrap" }; + tcb.createAsync(BlockContainerComponent).then(fixture => { + let component: ActivityComponent = fixture.debugElement.componentViewChildren[0].componentInstance; + expect(fixture.debugElement.queryAll(".activity.scrap").length).toEqual(1); + done(); + }); + }); }); }); diff --git a/src/app/profile/activities/activity/scrap.html b/src/app/profile/activities/activity/scrap.html new file mode 100644 index 0000000..ef8fc8f --- /dev/null +++ b/src/app/profile/activities/activity/scrap.html @@ -0,0 +1,17 @@ + + + + + +

+ + {{"activities.scrap.description" | translate}} +

+

+
+
+
+
+
+
+
diff --git a/src/languages/en.json b/src/languages/en.json index de958ff..2715489 100644 --- a/src/languages/en.json +++ b/src/languages/en.json @@ -21,6 +21,7 @@ "profile.person.title": "Person", "activities.title": "Activities", "activities.create_article.description": "has published on", + "activities.scrap.description": "wrote", "activities.add_member_in_community.description": "has joined the community", "activities.new_friendship.description": "has made {friends, plural, one{one new friend} other{# new friends}}:", "auth.title": "Great to have you back!", diff --git a/src/languages/pt.json b/src/languages/pt.json index bf47b27..cff9749 100644 --- a/src/languages/pt.json +++ b/src/languages/pt.json @@ -21,6 +21,7 @@ "profile.person.title": "Pessoa", "activities.title": "Atividades", "activities.create_article.description": "publicou em", + "activities.scrap.description": "escreveu", "activities.add_member_in_community.description": "entrou na comunidade", "activities.new_friendship.description": "fez {friends, plural, one{um novo amigo} other{# novos amigos}}:", "auth.title": "Legal ter vocĂȘ de volta!", -- libgit2 0.21.2