Skip to content

Commit 31923d9

Browse files
committed
--wip-- [skip ci]
test
1 parent 1efce86 commit 31923d9

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

packages/liquid-html-parser/src/stage-2-ast.spec.ts

+8-6
Original file line numberDiff line numberDiff line change
@@ -1221,27 +1221,29 @@ describe('Unit: Stage 2 (AST)', () => {
12211221
});
12221222

12231223
it(`should parse doc tags`, () => {
1224-
ast = toLiquidAST(`{% doc %} asdf {% enddoc %}`);
1224+
ast = toLiquidAST(`{% doc %}{% enddoc %}`);
12251225
expectPath(ast, 'children.0.type').to.eql('LiquidRawTag');
12261226
expectPath(ast, 'children.0.name').to.eql('doc');
1227-
expectPath(ast, 'children.0.body.value').to.eql(' asdf ');
1228-
expectPath(ast, 'children.0.body.type').toEqual('TextNode');
1227+
expectPath(ast, 'children.0.body.value').to.eql('');
1228+
expectPath(ast, 'children.0.body.type').toEqual('RawMarkup');
1229+
expectPath(ast, 'children.0.body.nodes').toEqual([]);
12291230

12301231
ast = toLiquidAST(`{% doc -%} single line doc {%- enddoc %}`);
12311232
expectPath(ast, 'children.0.type').to.eql('LiquidRawTag');
12321233
expectPath(ast, 'children.0.name').to.eql('doc');
12331234
expectPath(ast, 'children.0.body.value').to.eql(' single line doc ');
1234-
expectPath(ast, 'children.0.body.type').toEqual('TextNode');
1235+
expectPath(ast, 'children.0.body.nodes.0.type').toEqual('TextNode');
12351236

12361237
ast = toLiquidAST(`{% doc -%}
12371238
multi line doc
12381239
multi line doc
12391240
{%- enddoc %}`);
12401241
expectPath(ast, 'children.0.type').to.eql('LiquidRawTag');
12411242
expectPath(ast, 'children.0.name').to.eql('doc');
1242-
expectPath(ast, 'children.0.body.source').to.eql(
1243-
'{% doc -%}\n multi line doc\n multi line doc\n {%- enddoc %}',
1243+
expectPath(ast, 'children.0.body.nodes.0.value').to.eql(
1244+
`multi line doc\n multi line doc`,
12441245
);
1246+
expectPath(ast, 'children.0.body.nodes.0.type').toEqual('TextNode');
12451247
});
12461248

12471249
it('should parse unclosed tables with assignments', () => {

0 commit comments

Comments
 (0)