Skip to content

Commit 8037c5a

Browse files
committed
Fix Dialog unit test
1 parent da1cf99 commit 8037c5a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/app/component/modal-message/modal-message.component.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ describe('ModalMessageComponent', () => {
3030
});
3131

3232
it('should render markdown correctly in the dialog', () => {
33-
const dialogInfo: DialogInfo = new DialogInfo('A **test** markdown.');
33+
const dialogInfo: DialogInfo = new DialogInfo('A *test* _markdown_.');
3434
const dialogRef: MatDialogRef<ModalMessageComponent> = component.openDialog(dialogInfo);
3535

36-
expect(dialogRef.componentInstance.data.message).toContain('<strong>test</strong>');
36+
expect(dialogRef.componentInstance.data.message).toContain('<em>test</em>');
37+
expect(dialogRef.componentInstance.data.message).toContain('<em>markdown</em>');
3738
});
3839

3940
it('should render markdown correctly in the dialog', () => {

src/app/component/modal-message/modal-message.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ export class ModalMessageComponent implements OnInit {
6161
dialogInfo.message = template?.message?.replace('{message}', dialogInfo.message);
6262
}
6363

64-
dialogInfo.message = this.markdown.render(dialogInfo.message);
65-
6664
const dialogConfig = new MatDialogConfig();
6765
dialogConfig.id = 'modal-message';
6866
dialogConfig.disableClose = true;

0 commit comments

Comments
 (0)