Skip to content

Commit

Permalink
fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
0x41head committed Aug 16, 2024
1 parent cd87ee2 commit 3e28e1f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ <h1>
</mat-expansion-panel-header>
<mat-accordion multi="true">
<mat-expansion-panel
id="teamsEvidence"
*ngFor="let item of this.currentActivity.teamsEvidence | keyvalue">
<mat-expansion-panel-header>
<mat-panel-title>
Expand Down Expand Up @@ -163,7 +164,7 @@ <h1>
<b>References</b>
</mat-panel-title>
</mat-expansion-panel-header>
<p>
<p id="references">
<mat-accordion multi="true">
<mat-expansion-panel>
<mat-expansion-panel-header>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,13 @@ describe('ActivityDescriptionComponent', () => {
component.currentActivity.teamsEvidence = testEvidence;
fixture.detectChanges();
const HTMLElement: HTMLElement = fixture.nativeElement;
const contentDisplayedinParagraphTag =
HTMLElement.querySelector('#evidence')!;
expect(contentDisplayedinParagraphTag.textContent).toContain(testEvidence);
const parentElement = HTMLElement.querySelectorAll('#teamsEvidence')!;
console.log('parentElement', parentElement[1].textContent);
const lengthOfObject = Object.keys(testEvidence).length;
for (var i = 0; i > lengthOfObject; i++)
expect(parentElement[i].textContent).toContain(
Object.keys(testEvidence)[i] + Object.values(testEvidence)[i]
);
});

it('check if assessment is being generated', () => {
Expand Down Expand Up @@ -138,8 +142,10 @@ describe('ActivityDescriptionComponent', () => {

fixture.detectChanges();
const HTMLElement: HTMLElement = fixture.nativeElement;
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
expect(contentDisplayedinParagraphTag[10].textContent).toContain(
const contentDisplayedinParagraphTag =
HTMLElement.querySelectorAll('#references')!;

expect(contentDisplayedinParagraphTag[0].textContent).toContain(
component.SAMMVersion +
testSAMM[0] +
component.ISOVersion +
Expand Down

0 comments on commit 3e28e1f

Please sign in to comment.