Skip to content

Commit cee6f63

Browse files
authored
Merge pull request #182 from 0x41head/master
Added more tests to activity description
2 parents 14538c2 + d87f348 commit cee6f63

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,40 @@ describe('TaskDescriptionComponent', () => {
9292
testEvidence
9393
);
9494
});
95+
96+
it('check if assessment is being genenrated', () => {
97+
const testAssessment = 'Sample Assessment';
98+
component.currentTask.assessment = testAssessment;
99+
fixture.detectChanges();
100+
const HTMLElement: HTMLElement = fixture.nativeElement;
101+
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
102+
expect(contentDisplayedinParagraphTag[7].textContent).toContain(
103+
testAssessment
104+
);
105+
});
106+
107+
it('check if comments is being genenrated', () => {
108+
const testComments = 'Sample Comments';
109+
component.currentTask.comments = testComments;
110+
fixture.detectChanges();
111+
const HTMLElement: HTMLElement = fixture.nativeElement;
112+
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
113+
console.log(contentDisplayedinParagraphTag);
114+
expect(contentDisplayedinParagraphTag[10].textContent).toContain(
115+
testComments
116+
);
117+
});
118+
it('check if references is being genenrated', () => {
119+
const testSAMM = [' Sample SAMM '];
120+
const testISO = [' Sample ISO'];
121+
component.currentTask.samm = testSAMM;
122+
component.currentTask.iso = testISO;
123+
fixture.detectChanges();
124+
const HTMLElement: HTMLElement = fixture.nativeElement;
125+
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
126+
console.log(contentDisplayedinParagraphTag);
127+
expect(contentDisplayedinParagraphTag[9].textContent).toContain(
128+
'OWASP SAMM VERSION 2' + testSAMM[0] + 'ISO27001 2017' + testISO[0]
129+
);
130+
});
95131
});

0 commit comments

Comments
 (0)