/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/platform-server/test/render_spec.ts
49 строк
1 KB
Ady Elouej
fix(compiler): remove namespaced MathML script elements
08 авг 2026, 02:32
08 авг 2026, 02:32
107f6fa
Код
Авторство
О чём код?
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {Component} from '@angular/core'; import {ssr} from './hydration_utils'; describe('renderApplication', () => { it('should render ARIA attributes from attribute bindings', async () => { @Component({ selector: 'app', template: '<div [attr.aria-label]="label"></div>', }) class SomeComponent { label = 'some label'; } const html = await ssr(SomeComponent); expect(html).toContain('aria-label="some label"'); }); it('should render ARIA attributes using property binding syntax', async () => { @Component({ selector: 'app', template: '<div [aria-label]="label"></div>', }) class SomeComponent { label = 'a third label'; } const html = await ssr(SomeComponent); expect(html).toContain('aria-label="a third label"'); }); it('should not serialize MathML script elements', async () => { @Component({ selector: 'app', template: '<math><mtext><script>bad()</script></mtext></math>', }) class SomeComponent {} const html = await ssr(SomeComponent, {enableHydration: false}); expect(html).not.toContain('<script'); }); });