blob: 29dfd58b3159b76d5d7d264e60eb828d14a2a7f4 [file] [log] [blame]
// eslint-disable-next-line import/no-extraneous-dependencies
import { expect } from 'chai';
import {
loadCachedTestBed, takeScreenshot, TestBed,
} from '../../../puppeteer-tests/util';
describe('particles-player-sk', () => {
let testBed: TestBed;
before(async () => {
testBed = await loadCachedTestBed();
});
beforeEach(async () => {
await testBed.page.goto(testBed.baseUrl);
await testBed.page.setViewport({ width: 400, height: 800 });
});
it('should render the demo page', async () => {
// Smoke test.
expect(await testBed.page.$$('particles-player-sk')).to.have.length(1);
});
describe('screenshots', () => {
it('shows controls for uniforms', async () => {
// Wait for WASM to load.
await testBed.page.waitForSelector('#results #loaded');
await takeScreenshot(testBed.page, 'particles', 'particles-player-sk-with-uniforms');
});
it('does not show controls if there are no uniforms', async () => {
// Wait for WASM to load.
await testBed.page.click('#nouniforms');
await testBed.page.waitForSelector('#results #loaded');
await takeScreenshot(testBed.page, 'particles', 'particles-player-sk-without-uniforms');
});
});
});