/
githubmirror
/
components
Обзор
Документация
Войти
/
githubmirror
/
components
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/src/app/shared/documentation-items/documentation-items.spec.ts
42 строки
1 KB
Kristiyan Kostadinov
test: remove unnecessary test calls (#32396)
25 ноя 2025, 11:24
Не верифицирован
25 ноя 2025, 11:24
06c78b4
Код
Авторство
О чём код?
import {TestBed} from '@angular/core/testing'; import {DocumentationItems} from './documentation-items'; const COMPONENTS = 'components'; const CDK = 'cdk'; describe('DocViewer', () => { let docsItems: DocumentationItems; beforeEach(() => { docsItems = TestBed.inject(DocumentationItems); }); it('should get a list of all doc items', async () => { const items = await docsItems.getItems(COMPONENTS); expect(items).toBeDefined(); expect(items.length).toBeGreaterThan(0); for (const item of items) { expect(item.id).toBeDefined(); expect(item.name).toBeDefined(); } }); it('should get a doc item by id', async () => { expect(await docsItems.getItemById('button', 'material')).toBeDefined(); }); it('should be sorted alphabetically (components)', async () => { const items = await docsItems.getItems(COMPONENTS); const components = items.map(c => c.name); const sortedComponents = components.concat().sort(); expect(components).toEqual(sortedComponents); }); it('should be sorted alphabetically (cdk)', async () => { const items = await docsItems.getItems(CDK); const cdk = items.map(c => c.name); const sortedCdk = cdk.concat().sort(); expect(cdk).toEqual(sortedCdk); }); });