Skip to content

Commit

Permalink
Use SimpleDOM document in snapshot tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdale committed Nov 28, 2018
1 parent d19a854 commit 0c66e04
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions packages/@glimmer/test-helpers/test/i-n-u-r-test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { LazyRenderDelegate, RenderTest } from '@glimmer/test-helpers';
import { Simple } from '@glimmer/interfaces';
import createHTMLDocument from '@simple-dom/document';

const document = createHTMLDocument();

QUnit.module('Render Tests: I-N-U-R');

Expand All @@ -14,8 +17,8 @@ QUnit.test('Can set properties', assert => {
});

QUnit.test('Can take basic snapshots', assert => {
let div = document.createElement('div') as Simple.Element;
let text = document.createTextNode('Foo') as Simple.Text;
let div = document.createElement('div');
let text = document.createTextNode('Foo');
div.appendChild(text);

new class extends RenderTest {
Expand All @@ -29,9 +32,9 @@ QUnit.test('Can take basic snapshots', assert => {
});

QUnit.test('Can take nested snapshots', assert => {
let div = document.createElement('div') as Simple.Element;
let p = document.createElement('p') as Simple.Element;
let text = document.createTextNode('Foo') as Simple.Text;
let div = document.createElement('div');
let p = document.createElement('p');
let text = document.createTextNode('Foo');
p.appendChild(text);
div.appendChild(p);

Expand All @@ -46,10 +49,10 @@ QUnit.test('Can take nested snapshots', assert => {
});

QUnit.test('Can take nested snapshots of serialized blocks', assert => {
let div = document.createElement('div') as Simple.Element;
let open = document.createComment('<!--%+b:0%-->') as Simple.Comment;
let text = document.createTextNode('Foo') as Simple.Text;
let close = document.createComment('<!--%-b:0%-->') as Simple.Comment;
let div = document.createElement('div');
let open = document.createComment('<!--%+b:0%-->');
let text = document.createTextNode('Foo');
let close = document.createComment('<!--%-b:0%-->');
div.appendChild(open);
div.appendChild(text);
div.appendChild(close);
Expand Down

0 comments on commit 0c66e04

Please sign in to comment.