import {HtmlAst, HtmlAstVisitor, HtmlAttrAst, HtmlCommentAst, HtmlElementAst, HtmlExpansionAst, HtmlExpansionCaseAst, HtmlTextAst, htmlVisitAll} from '@angular/compiler/src/html_ast'; import {HtmlParser} from '@angular/compiler/src/html_parser'; import {beforeEach, ddescribe, describe, expect, it} from '@angular/core/testing/testing_internal'; export function main() { describe('HtmlAst serilaizer', () => { var parser: HtmlParser; beforeEach(() => { parser = new HtmlParser(); }); it('should support element', () => { const html = '
'; const ast = parser.parse(html, 'url'); expect(serializeAst(ast.rootNodes)).toEqual([html]); }); it('should support attributes', () => { const html = ''; const ast = parser.parse(html, 'url'); expect(serializeAst(ast.rootNodes)).toEqual([html]); }); it('should support text', () => { const html = 'some text'; const ast = parser.parse(html, 'url'); expect(serializeAst(ast.rootNodes)).toEqual([html]); }); it('should support expansion', () => { const html = '{number, plural, =0 {none} =1 {one} other {many}}'; const ast = parser.parse(html, 'url', true); expect(serializeAst(ast.rootNodes)).toEqual([html]); }); it('should support comment', () => { const html = ''; const ast = parser.parse(html, 'url', true); expect(serializeAst(ast.rootNodes)).toEqual([html]); }); it('should support nesting', () => { const html = `{number, plural, =0 {{sex, gender, other {?}}}}