mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[REF] compiler: rename qweb/ into compiler/
This commit is contained in:
committed by
Aaron Bohy
parent
7513b1e507
commit
1700a6fba3
@@ -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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user