Skip to content

Commit

Permalink
fixing tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Jan 17, 2023
1 parent 36902b5 commit a2937a4
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div>
<pre>{{displayModel.content}}</pre>
<pre>{{displayModel?.content}}</pre>
</div>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div>
<span>{{coding.display}}</span>
<span *ngIf="has_additional_info" [title]="coding.system">
({{coding.code || '?'}})
<span>{{coding?.display}}</span>
<span *ngIf="has_additional_info" [title]="coding?.system">
({{coding?.code || '?'}})
</span>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class HtmlComponent implements OnInit {
constructor(private sanitized: DomSanitizer) { }

ngOnInit(): void {
this.contentMarkup = this.sanitized.bypassSecurityTrustHtml(this.displayModel.content);
this.contentMarkup = this.sanitized.bypassSecurityTrustHtml(this.displayModel?.content);

}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div>
<img src="data:${{displayModel.content_type}};base64,${{displayModel.data}}" alt=""/>
<img src="data:${{displayModel?.content_type}};base64,${{displayModel?.data}}" alt=""/>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ describe('ImgComponent', () => {
});

it('should create', () => {


expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div>
<embed
src="data:${{displayModel.content_type}};base64,${{displayModel.data}}"
type="${{displayModel.content_type}}"
type="${{displayModel?.content_type}}"
[style]="{
width: '100%',
height: height
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ export class PdfComponent implements OnInit {

ngOnInit(): void {
const maxHeight = 600;
const contentHeight = (1111 * this.displayModel.data.length) / (24996 / 7.5);
this.height = Math.min(maxHeight, contentHeight);
if (this.displayModel){
const contentHeight = (1111 * this.displayModel?.data.length) / (24996 / 7.5);
this.height = Math.min(maxHeight, contentHeight);
}

}

}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<ng-container [ngTemplateOutlet]="
displayModel.content_type == 'application/pdf' ? showPdf :
displayModel.content_type == 'image/jpeg' ? showImg :
(displayModel.content_type == 'text/html' || displayModel.content_type == 'application/html') ? showHtml :
(displayModel.content_type == 'application/xml' || displayModel.content_type == 'application/json') ? showText :
displayModel?.content_type == 'application/pdf' ? showPdf :
displayModel?.content_type == 'image/jpeg' ? showImg :
(displayModel?.content_type == 'text/html' || displayModel?.content_type == 'application/html') ? showHtml :
(displayModel?.content_type == 'application/xml' || displayModel?.content_type == 'application/json') ? showText :
showEmpty
"></ng-container>

Expand Down

0 comments on commit a2937a4

Please sign in to comment.