blob: 220f14bae339691332887dc22f95039dbc234598 [file] [log] [blame]
import { expect } from 'chai';
import { loadCachedTestBed, takeScreenshot, TestBed } from '../../../puppeteer-tests/util';
describe('multi-zoom-sk', () => {
let testBed: TestBed;
before(async () => {
testBed = await loadCachedTestBed();
});
beforeEach(async () => {
await testBed.page.goto(testBed.baseUrl, { waitUntil: 'networkidle0' });
});
it('should render the demo page', async () => {
// Smoke test. There are 5 test cases we send to Gold and 1 extra in a dialog that we do not.
expect(await testBed.page.$$('multi-zoom-sk')).to.have.length(6);
});
describe('screenshots', () => {
it('looks good when left and right are a normal size', async () => {
const multiZoomSk = await testBed.page.$('#normal');
await takeScreenshot(multiZoomSk!, 'gold', 'multi-zoom-sk');
});
it('shows two images of different size', async () => {
const multiZoomSk = await testBed.page.$('#mismatch');
await takeScreenshot(multiZoomSk!, 'gold', 'multi-zoom-sk_mismatch');
});
it('works for two small base64 encoded images', async () => {
const multiZoomSk = await testBed.page.$('#base64');
await takeScreenshot(multiZoomSk!, 'gold', 'multi-zoom-sk_base64-small');
});
it('is zoomed in with the grid on', async () => {
const multiZoomSk = await testBed.page.$('#zoomed_grid');
await takeScreenshot(multiZoomSk!, 'gold', 'multi-zoom-sk_zoomed-grid');
});
it('shows nth largest pixel', async () => {
const multiZoomSk = await testBed.page.$('#base64_nthpixel');
await takeScreenshot(multiZoomSk!, 'gold', 'multi-zoom-sk_nth-pixel');
});
});
});