diff --git a/packages/@ember/-internals/glimmer/tests/integration/content-test.js b/packages/@ember/-internals/glimmer/tests/integration/content-test.js index 1d04465daab..b6c0bc28245 100644 --- a/packages/@ember/-internals/glimmer/tests/integration/content-test.js +++ b/packages/@ember/-internals/glimmer/tests/integration/content-test.js @@ -10,61 +10,135 @@ import { HAS_NATIVE_SYMBOL } from '@ember/-internals/utils'; import { constructStyleDeprecationMessage } from '@ember/-internals/views'; import { Component, SafeString, htmlSafe } from '../utils/helpers'; -moduleFor( - 'Static content tests', - class extends RenderingTestCase { - ['@test it can render a static text node']() { - this.render('hello'); - let text1 = this.assertTextNode(this.firstChild, 'hello'); +const EMPTY = Object.freeze({}); - runTask(() => this.rerender()); +const LITERALS = [ + ['foo', 'foo', '"foo"'], + [undefined, EMPTY], + [null, EMPTY], + [true, 'true'], + [false, 'false'], + [0, '0', '0'], + [-0, '0', '-0'], + [1, '1', '1'], + [-1, '-1', '-1'], + [0.0, '0', '0.0'], + [0.5, '0.5', '0.5'], +]; - let text2 = this.assertTextNode(this.firstChild, 'hello'); +let i = Number.MAX_SAFE_INTEGER; - this.assertSameNode(text1, text2); - } +while (i > 1) { + LITERALS.push([i, `${i}`, `${i}`]); + i = Math.round(i / 2); +} - ['@test it can render a static element']() { - this.render('
hello
'); - let p1 = this.assertElement(this.firstChild, { tagName: 'p' }); - let text1 = this.assertTextNode(this.firstChild.firstChild, 'hello'); +i = Number.MIN_SAFE_INTEGER; - runTask(() => this.rerender()); +while (i < -1) { + LITERALS.push([i, `${i}`, `${i}`]); + i = Math.round(i / 2); +} - let p2 = this.assertElement(this.firstChild, { tagName: 'p' }); - let text2 = this.assertTextNode(this.firstChild.firstChild, 'hello'); +class StaticContentTest extends RenderingTestCase { + ['@test it can render a static text node']() { + this.render('hello'); + let text1 = this.assertTextNode(this.firstChild, 'hello'); - this.assertSameNode(p1, p2); - this.assertSameNode(text1, text2); - } + runTask(() => this.rerender()); - ['@test it can render a static template']() { - let template = ` -hello
'); + let p1 = this.assertElement(this.firstChild, { tagName: 'p' }); + let text1 = this.assertTextNode(this.firstChild.firstChild, 'hello'); - this.assertHTML(template); - } + runTask(() => this.rerender()); + + let p2 = this.assertElement(this.firstChild, { tagName: 'p' }); + let text2 = this.assertTextNode(this.firstChild.firstChild, 'hello'); + + this.assertSameNode(p1, p2); + this.assertSameNode(text1, text2); } -); + + ['@test it can render a static template']() { + let template = ` +