/
githubmirror
/
ionic
Обзор
Документация
Войти
/
githubmirror
/
ionic
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
core/src/components/loading/test/loading.spec.ts
41 строка
2 KB
Sean Perkins
fix(overlays): assign incremental id to overlay host (#27278)
03 май 2023, 20:24
Не верифицирован
03 май 2023, 20:24
9313a91
Код
Авторство
О чём код?
import { newSpecPage } from '@stencil/core/testing'; import { config } from '../../../global/config'; import { Loading } from '../loading'; describe('loading: custom html', () => { it('should not allow for custom html by default', async () => { const page = await newSpecPage({ components: [Loading], html: `<ion-loading message="<button class='custom-html'>Custom Text</button>"></ion-loading>`, }); const content = page.body.querySelector('.loading-content')!; expect(content.textContent).toContain('Custom Text'); expect(content.querySelector('button.custom-html')).toBe(null); }); it('should allow for custom html', async () => { config.reset({ innerHTMLTemplatesEnabled: true }); const page = await newSpecPage({ components: [Loading], html: `<ion-loading message="<button class='custom-html'>Custom Text</button>"></ion-loading>`, }); const content = page.body.querySelector('.loading-content')!; expect(content.textContent).toContain('Custom Text'); expect(content.querySelector('button.custom-html')).not.toBe(null); }); it('should not allow for custom html', async () => { config.reset({ innerHTMLTemplatesEnabled: false }); const page = await newSpecPage({ components: [Loading], html: `<ion-loading message="<button class='custom-html'>Custom Text</button>"></ion-loading>`, }); const content = page.body.querySelector('.loading-content')!; expect(content.textContent).toContain('Custom Text'); expect(content.querySelector('button.custom-html')).toBe(null); }); });