[REF] initial prototype of owl 2

This commit is contained in:
Géry Debongnie
2020-11-26 16:45:25 +01:00
parent d615ffd81b
commit e00be61b8e
184 changed files with 29267 additions and 30463 deletions
+42
View File
@@ -0,0 +1,42 @@
import { renderToString, snapshotEverything } from "../helpers";
snapshotEverything();
// -----------------------------------------------------------------------------
// white space
// -----------------------------------------------------------------------------
describe("white space handling", () => {
test("white space only text nodes are condensed into a single space", () => {
const template = `<div> </div>`;
expect(renderToString(template)).toBe("<div> </div>");
});
test("consecutives whitespaces are condensed into a single space", () => {
const template = `<div> abc </div>`;
expect(renderToString(template)).toBe("<div> abc </div>");
});
test("whitespace only text nodes with newlines are removed", () => {
const template = `<div>
<span>abc</span>
</div>`;
expect(renderToString(template)).toBe("<div><span>abc</span></div>");
});
test("nothing is done in pre tags", () => {
const template1 = `<pre> </pre>`;
expect(renderToString(template1)).toBe(template1);
const template2 = `<pre>
some text
</pre>`;
expect(renderToString(template2)).toBe(template2);
const template3 = `<pre>
</pre>`;
expect(renderToString(template3)).toBe(template3);
});
});