Repository: ionic-team/ionic-framework
File: core/src/components/modal/test/basic/modal.e2e.ts (TypeScript)

Code before:
        el.dismiss();
      });

      await ionModalWillDismiss.next();
      await ionModalDidDismiss.next();

      await expect(modal).not.toHaveClass(/show-modal/);
      await expect(modal).toBeHidden();
    };

    test('should not have visual regressions', async ({ page }) => {
      await runVisualTests(page);
    });
    test('should not have visual regressions with tablet viewport', async ({ page }) => {
      await page.setViewportSize(Viewports.tablet.portrait);
      await runVisualTests(page, '-tablet');
    });
  });
});

configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => {
  test.describe(title('modal: parent removal observer'), () => {
    test('should not set up parentRemovalObserver for controller-created modals', async ({ page }, testInfo) => {
      testInfo.annotations.push({
        type: 'issue',
        description: 'https://github.com/ionic-team/ionic-framework/pull/30845',
      });

      await page.goto('/src/components/modal/test/basic', config);
      const ionModalDidPresent = await page.spyOnEvent('ionModalDidPresent');

      await page.click('#basic-modal');
      await ionModalDidPresent.next();

      const modal = page.locator('ion-modal');
      const hasObserver = await modal.evaluate((el: any) => {
        return el.parentRemovalObserver !== undefined;
      });

      expect(hasObserver).toBe(false);
    });
  });

  test.describe(title('modal: backdrop'), () => {
    test.beforeEach(async ({ page }) => {
      await page.goto('/src/components/modal/test/basic', config);
    });

    test('it should dismiss the modal when clicking the backdrop', async ({ page }) => {
      await page.setViewportSize(Viewports.tablet.portrait);


Review comment (suggestion):
Since the ticket is internal, then maybe we should do this instead:


```suggestion
        description: 'FW-6766',
```

It doesn't seem that description has to be a link.

Code after:
        el.dismiss();
      });

      await ionModalWillDismiss.next();
      await ionModalDidDismiss.next();

      await expect(modal).not.toHaveClass(/show-modal/);
      await expect(modal).toBeHidden();
    };

    test('should not have visual regressions', async ({ page }) => {
      await runVisualTests(page);
    });
    test('should not have visual regressions with tablet viewport', async ({ page }) => {
      await page.setViewportSize(Viewports.tablet.portrait);
      await runVisualTests(page, '-tablet');
    });
  });
});

configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => {
  test.describe(title('modal: parent removal observer'), () => {
    test('should not set up parentRemovalObserver for controller-created modals', async ({ page }, testInfo) => {
      testInfo.annotations.push({
        type: 'issue',
        description: 'FW-6766',
      });

      await page.goto('/src/components/modal/test/basic', config);
      const ionModalDidPresent = await page.spyOnEvent('ionModalDidPresent');

      await page.click('#basic-modal');
      await ionModalDidPresent.next();

      const modal = page.locator('ion-modal');
      const hasObserver = await modal.evaluate((el: any) => {
        return el.parentRemovalObserver !== undefined;
      });

      expect(hasObserver).toBe(false);
    });
  });

  test.describe(title('modal: backdrop'), () => {
    test.beforeEach(async ({ page }) => {
      await page.goto('/src/components/modal/test/basic', config);
    });

    test('it should dismiss the modal when clicking the backdrop', async ({ page }) => {
      await page.setViewportSize(Viewports.tablet.portrait);