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

Code before:
        const breakpoint = await modal.evaluate((el: HTMLIonModalElement) => el.getCurrentBreakpoint());
        expect(breakpoint).toBe(0.5);
      });
      test('should emit ionBreakpointDidChange', async ({ page }) => {
        const ionBreakpointDidChange = await page.spyOnEvent('ionBreakpointDidChange');
        const modal = page.locator('.modal-sheet');

        await modal.evaluate((el: HTMLIonModalElement) => el.setCurrentBreakpoint(0.5));
        await ionBreakpointDidChange.next();
        expect(ionBreakpointDidChange.events.length).toBe(1);
      });
      test('should emit ionBreakpointDidChange when breakpoint is set to 0', async ({ page }) => {
        const ionBreakpointDidChange = await page.spyOnEvent('ionBreakpointDidChange');
        const modal = page.locator('.modal-sheet');

        await modal.evaluate((el: HTMLIonModalElement) => el.setCurrentBreakpoint(0));
        await ionBreakpointDidChange.next();
        expect(ionBreakpointDidChange.events.length).toBe(1);
      });
      test('should emit ionBreakpointDidChange when the sheet is swiped to breakpoint 0', async ({ page }) => {
        const ionBreakpointDidChange = await page.spyOnEvent('ionBreakpointDidChange');
        const header = page.locator('.modal-sheet ion-header');

        await dragElementBy(header, page, 0, 125);

        await ionBreakpointDidChange.next();

        expect(ionBreakpointDidChange.events.length).toBe(1);
      });
    });

    test('it should reset the breakpoint value on dismiss', async ({ page }) => {
      await page.goto('/src/components/modal/test/sheet', config);
      test.info().annotations.push({
        type: 'issue',
        description: 'https://github.com/ionic-team/ionic-framework/issues/25245',
      });

      await page.setContent(
        `
        <ion-content>
          <ion-button id="open-modal">Open</ion-button>
          <ion-modal trigger="open-modal" initial-breakpoint="0.25">
            <ion-content>
              <ion-button id="dismiss" onclick="modal.dismiss();">Dismiss</ion-button>
              <ion-button id="set-breakpoint">Set breakpoint</ion-button>
            </ion-content>
          </ion-modal>
        </ion-content>
        <script>
          const modal = document.querySelector('ion-modal');

Review comment (suggestion):
Change required due to [errors when updating the snapshots](https://github.com/ionic-team/ionic-framework/actions/runs/15729294792).

> Error: The element is being dragged past the bottom of the viewport. Update the dragByY value to prevent going out of bounds. A recommended value is 110.5.

Code after:
        await ionBreakpointDidChange.next();

        const breakpoint = await modal.evaluate((el: HTMLIonModalElement) => el.getCurrentBreakpoint());
        expect(breakpoint).toBe(0.5);
      });
      test('should emit ionBreakpointDidChange', async ({ page }) => {
        const ionBreakpointDidChange = await page.spyOnEvent('ionBreakpointDidChange');
        const modal = page.locator('.modal-sheet');

        await modal.evaluate((el: HTMLIonModalElement) => el.setCurrentBreakpoint(0.5));
        await ionBreakpointDidChange.next();
        expect(ionBreakpointDidChange.events.length).toBe(1);
      });
      test('should emit ionBreakpointDidChange when breakpoint is set to 0', async ({ page }) => {
        const ionBreakpointDidChange = await page.spyOnEvent('ionBreakpointDidChange');
        const modal = page.locator('.modal-sheet');

        await modal.evaluate((el: HTMLIonModalElement) => el.setCurrentBreakpoint(0));
        await ionBreakpointDidChange.next();
        expect(ionBreakpointDidChange.events.length).toBe(1);
      });
      test('should emit ionBreakpointDidChange when the sheet is swiped to breakpoint 0', async ({ page }) => {
        const ionBreakpointDidChange = await page.spyOnEvent('ionBreakpointDidChange');
        const header = page.locator('.modal-sheet ion-header');

        await dragElementBy(header, page, 0, 110);

        await ionBreakpointDidChange.next();

        expect(ionBreakpointDidChange.events.length).toBe(1);
      });
    });

    test('it should reset the breakpoint value on dismiss', async ({ page }) => {
      await page.goto('/src/components/modal/test/sheet', config);
      test.info().annotations.push({
        type: 'issue',
        description: 'https://github.com/ionic-team/ionic-framework/issues/25245',
      });

      await page.setContent(
        `
        <ion-content>
          <ion-button id="open-modal">Open</ion-button>
          <ion-modal trigger="open-modal" initial-breakpoint="0.25">
            <ion-content>
              <ion-button id="dismiss" onclick="modal.dismiss();">Dismiss</ion-button>
              <ion-button id="set-breakpoint">Set breakpoint</ion-button>
            </ion-content>
          </ion-modal>
        </ion-content>