Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/capricorn86/happy-dom int…
…o task/450-typeerror-targetownerdocumentcreaterange-is-not-a-function
- Loading branch information
Showing
6 changed files
with
62 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
packages/happy-dom/test/nodes/html-template-element/HTMLTemplateElement.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import Window from '../../../src/window/Window'; | ||
import Document from '../../../src/nodes/document/Document'; | ||
import HTMLTemplateElement from '../../../src/nodes/html-template-element/HTMLTemplateElement'; | ||
|
||
describe('HTMLTemplateElement', () => { | ||
let window: Window; | ||
let document: Document; | ||
let element: HTMLTemplateElement; | ||
|
||
beforeEach(() => { | ||
window = new Window(); | ||
document = window.document; | ||
element = <HTMLTemplateElement>document.createElement('template'); | ||
}); | ||
|
||
afterEach(() => { | ||
jest.restoreAllMocks(); | ||
}); | ||
|
||
it('InnerHTML', () => { | ||
const div = '<div>happy-dom is cool!</div>'; | ||
expect(element.content.childNodes.length).toBe(0); | ||
element.innerHTML = div; | ||
expect(element.innerHTML).toBe(div); | ||
expect(element.content.childNodes.length).toBe(1); | ||
element.innerHTML = ''; | ||
expect(element.content.childNodes.length).toBe(0); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters