/
githubmirror
/
angular-cli
Обзор
Документация
Войти
/
githubmirror
/
angular-cli
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/angular/build/src/utils/index-file/ngcm-attribute_spec.ts
33 строки
899 B
Alan Agius
refactor(@angular/build): avoid hydration warnings when `RenderMode.Client` is set
02 окт 2024, 16:08
02 окт 2024, 16:08
80686be
Код
Авторство
О чём код?
/** * @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 { addNgcmAttribute } from './ngcm-attribute'; describe('addNgcmAttribute', () => { it('should add the ngcm attribute to the <body> tag', async () => { const result = await addNgcmAttribute(` <html> <head></head> <body><p>hello world!</p></body> </html> `); expect(result).toContain('<body ngcm=""><p>hello world!</p></body>'); }); it('should not override an existing ngcm attribute', async () => { const result = await addNgcmAttribute(` <html> <head></head> <body ngcm="foo"><p>hello world!</p></body> </html> `); expect(result).toContain('<body ngcm="foo"><p>hello world!</p></body>'); }); });