test(aio): add test for escaped newline in CodeComponent
This commit is contained in:
parent
9037593ab8
commit
04fb29b589
@ -107,10 +107,10 @@ describe('CodeComponent', () => {
|
|||||||
|
|
||||||
it('should remove common indentation from the code before rendering', () => {
|
it('should remove common indentation from the code before rendering', () => {
|
||||||
hostComponent.linenums = false;
|
hostComponent.linenums = false;
|
||||||
hostComponent.code = ' abc\n def\n ghi\n\n jkl\n';
|
hostComponent.code = ' abc\n let x = text.split(\'\\n\');\n ghi\n\n jkl\n';
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
const codeContent = codeComponentDe.nativeElement.querySelector('code').innerText;
|
const codeContent = codeComponentDe.nativeElement.querySelector('code').innerText;
|
||||||
expect(codeContent).toEqual('abc\n def\nghi\n\njkl');
|
expect(codeContent).toEqual('abc\n let x = text.split(\'\\n\');\nghi\n\njkl');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should trim whitespace from the code before rendering', () => {
|
it('should trim whitespace from the code before rendering', () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user