Skip to content
Snippets Groups Projects
Select Git revision
  • 794d09fbde530045f9ce6e9406ef221930e252e6
  • mui5-annotation-on-video-stable default
  • get_setter_canvasSizeInformations
  • fix-error-div-into-p
  • annotation-on-video-v2
  • detached
  • annotation-on-video-r17
  • mui5
  • mui5-react-18
  • jacob-test
  • annotation-on-video protected
  • master
  • test-antoinev1
  • 20-fetch-thumbnail-on-annotation
  • add-research-field
  • Save
  • add-plugin
  • 14-wip-no-seek-to
  • 14-bug-on-video-time-control
  • 9_wip_videotests
  • _upgrade_material_ui
  • latest-tetras-16
  • v3.3.0
  • v3.2.0
  • v3.1.1
  • v3.1.0
  • v3.0.0
  • v3.0.0-rc.7
  • v3.0.0-rc.6
  • v3.0.0-rc.5
  • v3.0.0-rc.4
  • v3.0.0-rc.3
  • v3.0.0-rc.2
  • v3.0.0-rc.1
  • v3.0.0-beta.10
  • v3.0.0-beta.9
  • v3.0.0-beta.8
  • v3.0.0-beta.7
  • v3.0.0-beta.6
  • v3.0.0-beta.5
  • v3.0.0-beta.3
41 results

OpenSeadragonViewer.test.js

Blame
  • invalid-api-response.test.js 1.51 KiB
    describe('Mirador Invalid API Response Handler Test', () => {
      /** */
      async function fetchManifest(uri) {
        await page.evaluate(() => {
          document.querySelector('#addBtn').click();
        });
    
        await page.evaluate(() => {
          document.querySelector('.mirador-add-resource-button').click();
        });
        await page.waitForTimeout(50);
        await expect(page).toFill('#manifestURL', uri);
    
        await expect(page).toClick('#fetchBtn');
      }
    
      beforeEach(async () => {
        await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/blank.html');
      });
      it('breaks Mirador', async () => {
        await fetchManifest('http://127.0.0.1:4488/invalid');
        await expect(page).toMatchElement('li', { text: 'http://127.0.0.1:4488/invalid', timeout: 2000 });
      }, 10000);
    
      it('renders an error message when a manifest cannot be loaded (and allows it to be dismissed)', async () => {
        await fetchManifest('http://127.0.0.1:4488/__tests__/fixtures/version-2/broken');
    
        await expect(page).toMatchElement('p', { text: 'The resource cannot be added:', timeout: 2000 });
        await expect(page).toMatchElement('p', { text: 'http://127.0.0.1:4488/__tests__/fixtures/version-2/broken' });
    
        await expect(page).toClick('button', { text: 'Dismiss' });
    
        await page.waitForFunction(() => !document.querySelector('li[data-manifestid="http://127.0.0.1:4488/__tests__/fixtures/version-2/broken"]'));
    
        await expect(page).not.toMatchElement(
          'p',
          { text: 'The resource cannot be added:', timeout: 2000 },
        );
      }, 10000);
    });