Skip to content

Commit

Permalink
test(modal): enable tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thetaPC committed Jul 19, 2023
1 parent 93d8760 commit 134a5be
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
7 changes: 1 addition & 6 deletions core/src/components/modal/test/card-nav/modal.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ import { CardModalPage } from '../fixtures';
configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => {
test.describe(title('card modal - nav'), () => {
let cardModalPage: CardModalPage;
test.beforeEach(async ({ page, skip }) => {
skip.browser(
(browserName: string) => browserName !== 'chromium',
'dragElementBy is flaky outside of Chrome browsers.'
);

test.beforeEach(async ({ page }) => {
cardModalPage = new CardModalPage(page);
await cardModalPage.navigate('/src/components/modal/test/card-nav?ionic:_testing=false', config);
});
Expand Down
8 changes: 4 additions & 4 deletions core/src/components/modal/test/card/modal-tablet.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) =>
test('it should not swipe to close when swiped on the content but the content is scrolled', async ({ page }) => {
const modal = await cardModalPage.openModalByTrigger('#card');

const content = (await page.$('ion-modal ion-content'))!;
const content = page.locator('ion-modal ion-content');
await content.evaluate((el: HTMLIonContentElement) => el.scrollToBottom(0));

await cardModalPage.swipeToCloseModal('ion-modal ion-content', false);

await content.waitForElementState('stable');
await content.waitFor();
await expect(modal).toBeVisible();
});
test('it should not swipe to close when swiped on the content but the content is scrolled even when content is replaced', async ({
Expand All @@ -76,12 +76,12 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) =>

await page.click('ion-button.replace');

const content = (await page.$('ion-modal ion-content'))!;
const content = page.locator('ion-modal ion-content');
await content.evaluate((el: HTMLIonContentElement) => el.scrollToBottom(0));

await cardModalPage.swipeToCloseModal('ion-modal ion-content', false);

await content.waitForElementState('stable');
await content.waitFor();
await expect(modal).toBeVisible();
});
test('content should be scrollable after gesture ends', async ({ page }) => {
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/modal/test/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class CardModalPage {
this.ionModalDidDismiss = await page.spyOnEvent('ionModalDidDismiss');
}
async openModalByTrigger(selector: string) {
await this.page.click(selector);
await this.page.locator(selector).click();
await this.ionModalDidPresent.next();

return this.page.locator('ion-modal');
Expand Down

0 comments on commit 134a5be

Please sign in to comment.