Skip to content

Commit d0eed07

Browse files
committed
Added more tests to activity description
1 parent b5e004d commit d0eed07

1 file changed

Lines changed: 39 additions & 4 deletions

File tree

src/app/component/task-description/task-description.component.spec.ts

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,51 @@ describe('TaskDescriptionComponent', () => {
4545
component.currentTask.description = testDescription;
4646
fixture.detectChanges();
4747
const HTMLElement: HTMLElement = fixture.nativeElement;
48-
const heading = HTMLElement.querySelectorAll('p')!;
49-
expect(heading[0].textContent).toContain(testDescription);
48+
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
49+
expect(contentDisplayedinParagraphTag[0].textContent).toContain(
50+
testDescription
51+
);
5052
});
5153

5254
it('check if risk is being genenrated', () => {
5355
const testRisk = 'Sample Risk';
5456
component.currentTask.risk = testRisk;
5557
fixture.detectChanges();
5658
const HTMLElement: HTMLElement = fixture.nativeElement;
57-
const heading = HTMLElement.querySelectorAll('p')!;
58-
expect(heading[1].textContent).toContain(testRisk);
59+
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
60+
expect(contentDisplayedinParagraphTag[1].textContent).toContain(testRisk);
61+
});
62+
63+
it('check if measure is being genenrated', () => {
64+
const testMeasure = 'Sample Measure';
65+
component.currentTask.measure = testMeasure;
66+
fixture.detectChanges();
67+
const HTMLElement: HTMLElement = fixture.nativeElement;
68+
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
69+
expect(contentDisplayedinParagraphTag[2].textContent).toContain(
70+
testMeasure
71+
);
72+
});
73+
74+
it('check if implementation guide is being genenrated', () => {
75+
const testImplementationGuide = 'Sample Implementation Guide';
76+
component.currentTask.implementatonGuide = testImplementationGuide;
77+
fixture.detectChanges();
78+
const HTMLElement: HTMLElement = fixture.nativeElement;
79+
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
80+
expect(contentDisplayedinParagraphTag[3].textContent).toContain(
81+
testImplementationGuide
82+
);
83+
});
84+
85+
it('check if evidence is being genenrated', () => {
86+
const testEvidence = 'Sample Evidence';
87+
component.currentTask.evidence = testEvidence;
88+
fixture.detectChanges();
89+
const HTMLElement: HTMLElement = fixture.nativeElement;
90+
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
91+
expect(contentDisplayedinParagraphTag[6].textContent).toContain(
92+
testEvidence
93+
);
5994
});
6095
});

0 commit comments

Comments
 (0)