Skip to content

Commit 1c71bfb

Browse files
Merge pull request #27407 from ionic-team/chore/sync-with-main-6
chore: sync with main
2 parents 4a68705 + 8043fcf commit 1c71bfb

File tree

1,333 files changed

+8747
-6747
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,333 files changed

+8747
-6747
lines changed

.github/workflows/actions/test-angular-e2e/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ runs:
2929
shell: bash
3030
working-directory: ./angular/test
3131
- name: Install Dependencies
32-
run: npm install --legacy-peer-deps
32+
run: npm install
3333
shell: bash
3434
working-directory: ./angular/test/build/${{ inputs.app }}
3535
- name: Sync Built Changes

angular/test/apps/ng16/package-lock.json

+3,438-2,218
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

angular/test/apps/ng16/package.json

+21-21
Original file line numberDiff line numberDiff line change
@@ -19,37 +19,37 @@
1919
"test.watch": "concurrently \"npm run start\" \"wait-on http-get://localhost:4200 && npm run cy.open\" --kill-others --success first"
2020
},
2121
"dependencies": {
22-
"@angular/animations": "^16.0.0-rc.0",
23-
"@angular/common": "^16.0.0-rc.0",
24-
"@angular/compiler": "^16.0.0-rc.0",
25-
"@angular/core": "^16.0.0-rc.0",
26-
"@angular/forms": "^16.0.0-rc.0",
27-
"@angular/platform-browser": "^16.0.0-rc.0",
28-
"@angular/platform-browser-dynamic": "^16.0.0-rc.0",
29-
"@angular/platform-server": "^16.0.0-rc.0",
30-
"@angular/router": "^16.0.0-rc.0",
22+
"@angular/animations": "^16.0.0",
23+
"@angular/common": "^16.0.0",
24+
"@angular/compiler": "^16.0.0",
25+
"@angular/core": "^16.0.0",
26+
"@angular/forms": "^16.0.0",
27+
"@angular/platform-browser": "^16.0.0",
28+
"@angular/platform-browser-dynamic": "^16.0.0",
29+
"@angular/platform-server": "^16.0.0",
30+
"@angular/router": "^16.0.0",
3131
"@ionic/angular": "^7.0.0",
3232
"@ionic/angular-server": "^7.0.0",
33-
"@nguniversal/express-engine": "^15.0.0",
33+
"@nguniversal/express-engine": "^16.0.0",
3434
"core-js": "^2.6.11",
3535
"express": "^4.15.2",
36-
"ionicons": "^6.0.4",
36+
"ionicons": "^7.0.4",
3737
"rxjs": "~7.8.0",
3838
"tslib": "^2.3.0",
3939
"typescript-eslint-language-service": "^4.1.5",
4040
"zone.js": "~0.13.0"
4141
},
4242
"devDependencies": {
43-
"@angular-devkit/build-angular": "^16.0.0-rc.0",
44-
"@angular-eslint/builder": "^15.0.0",
45-
"@angular-eslint/eslint-plugin": "^15.0.0",
46-
"@angular-eslint/eslint-plugin-template": "^15.0.0",
47-
"@angular-eslint/schematics": "^15.0.0",
48-
"@angular-eslint/template-parser": "^15.0.0",
49-
"@angular/cli": "^16.0.0-rc.0",
50-
"@angular/compiler-cli": "^16.0.0-rc.0",
51-
"@angular/language-service": "^16.0.0-rc.0",
52-
"@nguniversal/builders": "^15.0.0",
43+
"@angular-devkit/build-angular": "^16.0.0",
44+
"@angular-eslint/builder": "^16.0.0",
45+
"@angular-eslint/eslint-plugin": "^16.0.0",
46+
"@angular-eslint/eslint-plugin-template": "^16.0.0",
47+
"@angular-eslint/schematics": "^16.0.0",
48+
"@angular-eslint/template-parser": "^16.0.0",
49+
"@angular/cli": "^16.0.0",
50+
"@angular/compiler-cli": "^16.0.0",
51+
"@angular/language-service": "^16.0.0",
52+
"@nguniversal/builders": "^16.0.0",
5353
"@types/express": "^4.17.7",
5454
"@types/node": "^12.12.54",
5555
"@typescript-eslint/eslint-plugin": "4.28.2",

angular/test/base/e2e/src/modal.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,4 @@ describe('when in a modal', () => {
121121
cy.get('#set-to-null').click();
122122
cy.get('#inputWithFloatingLabel').should('not.have.class', 'item-has-value');
123123
});
124-
});
124+
});

angular/test/base/scripts/sync.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ npm pack ../../../dist
1515
npm pack ../../../../packages/angular-server/dist
1616

1717
# Install Dependencies
18-
npm install *.tgz --no-save --legacy-peer-deps
18+
npm install *.tgz --no-save
1919

2020
# Delete Angular cache directory
2121
rm -rf .angular/

angular/test/base/src/app/modal-inline/modal-inline.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
</ion-list>
1818
</ion-content>
1919
</ng-template>
20-
</ion-modal>
20+
</ion-modal>

angular/test/base/src/app/modal-inline/modal-inline.component.ts

+1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ export class ModalInlineComponent implements AfterViewInit {
2424
onBreakpointDidChange() {
2525
this.breakpointDidChangeCounter++;
2626
}
27+
2728
}

core/README.md

+1-1

core/src/components/action-sheet/action-sheet.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
prepareOverlay,
1313
present,
1414
safeCall,
15+
setOverlayId,
1516
} from '@utils/overlays';
1617
import { getClassMap } from '@utils/theme';
1718

@@ -311,6 +312,10 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
311312
this.triggerController.removeClickListener();
312313
}
313314

315+
componentWillLoad() {
316+
setOverlayId(this.el);
317+
}
318+
314319
componentDidLoad() {
315320
/**
316321
* Do not create gesture if:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { newSpecPage } from '@stencil/core/testing';
2+
3+
import { ActionSheet } from '../action-sheet';
4+
5+
it('action sheet should be assigned an incrementing id', async () => {
6+
const page = await newSpecPage({
7+
components: [ActionSheet],
8+
html: `<ion-action-sheet is-open="true"></ion-action-sheet>`,
9+
});
10+
let actionSheet: HTMLIonActionSheetElement;
11+
12+
actionSheet = page.body.querySelector('ion-action-sheet')!;
13+
14+
expect(actionSheet).not.toBe(null);
15+
expect(actionSheet.getAttribute('id')).toBe('ion-overlay-1');
16+
17+
// Remove the action sheet from the DOM
18+
actionSheet.remove();
19+
await page.waitForChanges();
20+
21+
// Create a new action sheet to verify the id is incremented
22+
actionSheet = document.createElement('ion-action-sheet');
23+
actionSheet.isOpen = true;
24+
page.body.appendChild(actionSheet);
25+
await page.waitForChanges();
26+
27+
actionSheet = page.body.querySelector('ion-action-sheet')!;
28+
29+
expect(actionSheet.getAttribute('id')).toBe('ion-overlay-2');
30+
31+
// Presenting the same action sheet again should reuse the existing id
32+
33+
actionSheet.isOpen = false;
34+
await page.waitForChanges();
35+
actionSheet.isOpen = true;
36+
await page.waitForChanges();
37+
38+
actionSheet = page.body.querySelector('ion-action-sheet')!;
39+
40+
expect(actionSheet.getAttribute('id')).toBe('ion-overlay-2');
41+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { configs, test } from '@utils/test/playwright';
2+
3+
import { ActionSheetFixture } from './fixture';
4+
5+
configs().forEach(({ config, screenshot, title }) => {
6+
test.describe(title('action sheet: variant rendering'), () => {
7+
let actionSheetFixture!: ActionSheetFixture;
8+
test.beforeEach(async ({ page }) => {
9+
actionSheetFixture = new ActionSheetFixture(page, screenshot);
10+
11+
await page.goto(`/src/components/action-sheet/test/basic`, config);
12+
});
13+
test('should open basic action sheet', async () => {
14+
await actionSheetFixture.open('#basic');
15+
await actionSheetFixture.screenshot('basic');
16+
17+
/**
18+
* We want to test that the dismiss method
19+
* actually works, but we do not need to test
20+
* it every time. As a result, we only
21+
* call dismiss in this test.
22+
*/
23+
await actionSheetFixture.dismiss();
24+
});
25+
test('should open cancel only action sheet', async () => {
26+
await actionSheetFixture.open('#cancelOnly');
27+
await actionSheetFixture.screenshot('cancel-only');
28+
});
29+
test('should open custom action sheet', async () => {
30+
await actionSheetFixture.open('#custom');
31+
await actionSheetFixture.screenshot('custom');
32+
});
33+
test('should open scrollable action sheet', async () => {
34+
await actionSheetFixture.open('#scrollableOptions');
35+
await actionSheetFixture.screenshot('scrollable-options');
36+
});
37+
test('should open scrollable action sheet without cancel', async () => {
38+
await actionSheetFixture.open('#scrollWithoutCancel');
39+
await actionSheetFixture.screenshot('scroll-without-cancel');
40+
});
41+
});
42+
});
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import { expect } from '@playwright/test';
2-
import type { Locator } from '@playwright/test';
32
import { configs, test } from '@utils/test/playwright';
4-
import type { E2EPage } from '@utils/test/playwright';
53

6-
configs({ directions: ['ltr'] }).forEach(({ config, title }) => {
4+
import { ActionSheetFixture } from './fixture';
5+
6+
/**
7+
* This behavior does not vary across modes/directions
8+
*/
9+
configs({ mode: ['ios'], directions: ['ltr'] }).forEach(({ config, title }) => {
710
test.describe(title('action sheet: data'), () => {
811
let actionSheetFixture!: ActionSheetFixture;
912
test.beforeEach(async ({ page }) => {
@@ -35,58 +38,11 @@ configs({ directions: ['ltr'] }).forEach(({ config, title }) => {
3538
});
3639
});
3740
});
38-
configs({ directions: ['ltr'] }).forEach(({ config, title }) => {
39-
test.describe(title('action sheet: attributes'), () => {
40-
test('should set htmlAttributes', async ({ page }) => {
41-
await page.goto(`/src/components/action-sheet/test/basic`, config);
42-
const actionSheetFixture = new ActionSheetFixture(page);
43-
44-
await actionSheetFixture.open('#basic');
45-
46-
const actionSheet = page.locator('ion-action-sheet');
47-
await expect(actionSheet).toHaveAttribute('data-testid', 'basic-action-sheet');
48-
});
49-
});
50-
});
51-
configs().forEach(({ config, screenshot, title }) => {
52-
test.describe(title('action sheet: variant rendering'), () => {
53-
let actionSheetFixture!: ActionSheetFixture;
54-
test.beforeEach(async ({ page }) => {
55-
actionSheetFixture = new ActionSheetFixture(page, screenshot);
5641

57-
await page.goto(`/src/components/action-sheet/test/basic`, config);
58-
});
59-
test('should open basic action sheet', async () => {
60-
await actionSheetFixture.open('#basic');
61-
await actionSheetFixture.screenshot('basic');
62-
63-
/**
64-
* We want to test that the dismiss method
65-
* actually works, but we do not need to test
66-
* it every time. As a result, we only
67-
* call dismiss in this test.
68-
*/
69-
await actionSheetFixture.dismiss();
70-
});
71-
test('should open cancel only action sheet', async () => {
72-
await actionSheetFixture.open('#cancelOnly');
73-
await actionSheetFixture.screenshot('cancel-only');
74-
});
75-
test('should open custom action sheet', async () => {
76-
await actionSheetFixture.open('#custom');
77-
await actionSheetFixture.screenshot('custom');
78-
});
79-
test('should open scrollable action sheet', async () => {
80-
await actionSheetFixture.open('#scrollableOptions');
81-
await actionSheetFixture.screenshot('scrollable-options');
82-
});
83-
test('should open scrollable action sheet without cancel', async () => {
84-
await actionSheetFixture.open('#scrollWithoutCancel');
85-
await actionSheetFixture.screenshot('scroll-without-cancel');
86-
});
87-
});
88-
});
89-
configs({ directions: ['ltr'] }).forEach(({ config, title }) => {
42+
/**
43+
* This behavior does not vary across modes/directions
44+
*/
45+
configs({ mode: ['ios'], directions: ['ltr'] }).forEach(({ config, title }) => {
9046
test.describe(title('action sheet: variant functionality'), () => {
9147
let actionSheetFixture!: ActionSheetFixture;
9248
test.beforeEach(async ({ page }) => {
@@ -118,7 +74,11 @@ configs({ directions: ['ltr'] }).forEach(({ config, title }) => {
11874
});
11975
});
12076
});
121-
configs({ directions: ['ltr'] }).forEach(({ config, title }) => {
77+
78+
/**
79+
* This behavior does not vary across modes/directions
80+
*/
81+
configs({ mode: ['ios'], directions: ['ltr'] }).forEach(({ config, title }) => {
12282
test.describe(title('action sheet: focus trap'), () => {
12383
test('it should trap focus in action sheet', async ({ page, browserName }) => {
12484
await page.goto(`/src/components/action-sheet/test/basic`, config);
@@ -140,42 +100,3 @@ configs({ directions: ['ltr'] }).forEach(({ config, title }) => {
140100
});
141101
});
142102
});
143-
144-
class ActionSheetFixture {
145-
readonly page: E2EPage;
146-
readonly screenshotFn?: (file: string) => string;
147-
148-
private actionSheet!: Locator;
149-
150-
constructor(page: E2EPage, screenshot?: (file: string) => string) {
151-
this.page = page;
152-
this.screenshotFn = screenshot;
153-
}
154-
155-
async open(selector: string) {
156-
const ionActionSheetDidPresent = await this.page.spyOnEvent('ionActionSheetDidPresent');
157-
await this.page.locator(selector).click();
158-
await ionActionSheetDidPresent.next();
159-
this.actionSheet = this.page.locator('ion-action-sheet');
160-
await expect(this.actionSheet).toBeVisible();
161-
}
162-
163-
async dismiss() {
164-
const ionActionSheetDidDismiss = await this.page.spyOnEvent('ionActionSheetDidDismiss');
165-
await this.actionSheet.evaluate((el: HTMLIonActionSheetElement) => el.dismiss());
166-
await ionActionSheetDidDismiss.next();
167-
await expect(this.actionSheet).not.toBeVisible();
168-
}
169-
170-
async screenshot(modifier: string) {
171-
const { screenshotFn } = this;
172-
173-
if (!screenshotFn) {
174-
throw new Error(
175-
'A screenshot function is required to take a screenshot. Pass one in when creating ActionSheetFixture.'
176-
);
177-
}
178-
179-
await expect(this.actionSheet).toHaveScreenshot(screenshotFn(`action-sheet-${modifier}-diff`));
180-
}
181-
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { h } from '@stencil/core';
2+
import { newSpecPage } from '@stencil/core/testing';
3+
4+
import { ActionSheet } from '../../action-sheet';
5+
6+
describe('action sheet: htmlAttributes inheritance', () => {
7+
it('should correctly inherit attributes on host', async () => {
8+
const page = await newSpecPage({
9+
components: [ActionSheet],
10+
template: () => <ion-action-sheet htmlAttributes={{ 'data-testid': 'basic-action-sheet' }}></ion-action-sheet>,
11+
});
12+
13+
const actionSheet = page.body.querySelector('ion-action-sheet');
14+
15+
await expect(actionSheet.getAttribute('data-testid')).toBe('basic-action-sheet');
16+
});
17+
});

0 commit comments

Comments
 (0)