[REF] compiler: rename qweb/ into compiler/

This commit is contained in:
Géry Debongnie
2021-11-13 08:41:53 +01:00
committed by Aaron Bohy
parent 7513b1e507
commit 1700a6fba3
50 changed files with 10 additions and 10 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);
});
});