Skip to content

Commit 155cfea

Browse files
mmalerbaamysorto
authored andcommitted
fix(material-experimental/mdc-dialog): use same container selector as non-mdc version (#23074)
(cherry picked from commit 8b2ec8b)
1 parent fe1de10 commit 155cfea

File tree

3 files changed

+50
-50
lines changed

3 files changed

+50
-50
lines changed

src/material-experimental/mdc-dialog/dialog-container.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {cssClasses, numbers} from '@material/dialog';
2727
* @docs-private
2828
*/
2929
@Component({
30-
selector: 'mat-mdc-dialog-container',
30+
selector: 'mat-dialog-container',
3131
templateUrl: 'dialog-container.html',
3232
styleUrls: ['dialog.css'],
3333
encapsulation: ViewEncapsulation.None,

src/material-experimental/mdc-dialog/dialog.e2e.spec.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('MDC-based dialog', () => {
1212

1313
it('should open a dialog', async () => {
1414
await element(by.id('default')).click();
15-
await expectToExist('mat-mdc-dialog-container');
15+
await expectToExist('mat-dialog-container');
1616
});
1717

1818
it('should open a template dialog', async () => {
@@ -26,39 +26,39 @@ describe('MDC-based dialog', () => {
2626

2727
await waitForDialog();
2828
await clickOnBackdrop();
29-
await expectToExist('mat-mdc-dialog-container', false);
29+
await expectToExist('mat-dialog-container', false);
3030
});
3131

3232
it('should close by pressing escape', async () => {
3333
await element(by.id('default')).click();
3434

3535
await waitForDialog();
3636
await pressKeys(Key.ESCAPE);
37-
await expectToExist('mat-mdc-dialog-container', false);
37+
await expectToExist('mat-dialog-container', false);
3838
});
3939

4040
it('should close by pressing escape when the first tabbable element has lost focus', async () => {
4141
await element(by.id('default')).click();
4242

4343
await waitForDialog();
44-
await clickElementAtPoint('mat-mdc-dialog-container', {x: 0, y: 0});
44+
await clickElementAtPoint('mat-dialog-container', {x: 0, y: 0});
4545
await pressKeys(Key.ESCAPE);
46-
await expectToExist('mat-mdc-dialog-container', false);
46+
await expectToExist('mat-dialog-container', false);
4747
});
4848

4949
it('should close by clicking on the "close" button', async () => {
5050
await element(by.id('default')).click();
5151

5252
await waitForDialog();
5353
await element(by.id('close')).click();
54-
await expectToExist('mat-mdc-dialog-container', false);
54+
await expectToExist('mat-dialog-container', false);
5555
});
5656

5757
it('should focus the first focusable element', async () => {
5858
await element(by.id('default')).click();
5959

6060
await waitForDialog();
61-
await expectFocusOn('mat-mdc-dialog-container input');
61+
await expectFocusOn('mat-dialog-container input');
6262
});
6363

6464
it('should restore focus to the element that opened the dialog', async () => {
@@ -84,19 +84,19 @@ describe('MDC-based dialog', () => {
8484

8585
await waitForDialog();
8686
await clickOnBackdrop();
87-
await expectToExist('mat-mdc-dialog-container');
87+
await expectToExist('mat-dialog-container');
8888
});
8989

9090
it('should be able to prevent closing by pressing escape', async () => {
9191
await element(by.id('disabled')).click();
9292

9393
await waitForDialog();
9494
await pressKeys(Key.ESCAPE);
95-
await expectToExist('mat-mdc-dialog-container');
95+
await expectToExist('mat-dialog-container');
9696
});
9797

9898
async function waitForDialog() {
99-
await waitForElement('mat-mdc-dialog-container');
99+
await waitForElement('mat-dialog-container');
100100
}
101101

102102
async function clickOnBackdrop() {

0 commit comments

Comments
 (0)