/
githubmirror
/
pixijs
Обзор
Документация
Войти
/
githubmirror
/
pixijs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
src/scene/__tests__/allowChildren.test.ts
40 строк
2 KB
Matt Karl
chore: Reorganize tests into more conventional structure (#11126)
04 дек 2024, 23:36
Не верифицирован
04 дек 2024, 23:36
a68e311
Код
Авторство
О чём код?
import { Container } from '../container/Container'; import { Graphics } from '../graphics/shared/Graphics'; import { Mesh } from '../mesh/shared/Mesh'; import { MeshGeometry } from '../mesh/shared/MeshGeometry'; import { Sprite } from '../sprite/Sprite'; import { NineSliceSprite } from '../sprite-nine-slice/NineSliceSprite'; import { TilingSprite } from '../sprite-tiling/TilingSprite'; import { Text } from '../text/Text'; import { getTexture } from '@test-utils'; describe('allowChildren', () => { it('should accept children', () => { const container = new Container(); const sprite = new Sprite(); const text = new Text('Hello, world!'); const quadGeometry = new MeshGeometry({ positions: new Float32Array([-10, -10, 10, -10, 10, 10, -10, 10]), uvs: new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]), indices: new Uint32Array([0, 1, 2, 0, 2, 3]), // triangle 1); }); const mesh = new Mesh({ texture: getTexture(), geometry: quadGeometry }); const tilingSprite = new TilingSprite(); const nineSlice = new NineSliceSprite(getTexture()); const graphics = new Graphics(); expect(container.allowChildren).toBe(true); expect(sprite.allowChildren).toBe(false); expect(text.allowChildren).toBe(false); expect(mesh.allowChildren).toBe(false); expect(tilingSprite.allowChildren).toBe(false); expect(nineSlice.allowChildren).toBe(false); expect(graphics.allowChildren).toBe(false); }); });