Skip to content

Commit 6daac7d

Browse files
committed
add module to appmodule
1 parent 85e9f1a commit 6daac7d

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

apps/example-app/app/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { ComponentWithProviderComponent } from './examples/05-component-provider
2121
import { WithNgRxStoreComponent, reducer } from './examples/06-with-ngrx-store';
2222
import { WithNgRxMockStoreComponent } from './examples/07-with-ngrx-mock-store';
2323
import { MasterComponent, DetailComponent, HiddenDetailComponent } from './examples/09-router';
24+
import { DialogContentComponentModule } from './examples/15-dialog.component';
2425

2526
function reducerItems() {
2627
return ['One', 'Two', 'Three'];
@@ -57,6 +58,7 @@ function reducerItems() {
5758
value: reducer,
5859
items: reducerItems,
5960
}),
61+
DialogContentComponentModule,
6062
],
6163
bootstrap: [AppComponent],
6264
})

apps/example-app/app/examples/15-dialog.component.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { MatDialogModule, MatDialogRef } from '@angular/material/dialog';
22
import { render, screen, fireEvent, waitForElementToBeRemoved } from '@testing-library/angular';
33

4-
import { DialogComponent, DialogContentDialogComponent, DialogContentDialogModule } from './15-dialog.component';
4+
import { DialogComponent, DialogContentComponent, DialogContentComponentModule } from './15-dialog.component';
55

66
test('dialog closes', async () => {
77
const closeFn = jest.fn();
8-
const { fixture } = await render(DialogContentDialogComponent, {
8+
await render(DialogContentComponent, {
99
imports: [MatDialogModule],
1010
providers: [
1111
{
@@ -23,9 +23,9 @@ test('dialog closes', async () => {
2323
expect(closeFn).toHaveBeenCalledTimes(1);
2424
});
2525

26-
test('opens and closes the dialog with buttons', async () => {
26+
test.only('opens and closes the dialog with buttons', async () => {
2727
await render(DialogComponent, {
28-
imports: [MatDialogModule, DialogContentDialogModule],
28+
imports: [MatDialogModule, DialogContentComponentModule],
2929
});
3030

3131
const openDialogButton = await screen.findByRole('button', { name: /open dialog/i });
@@ -45,7 +45,7 @@ test('opens and closes the dialog with buttons', async () => {
4545

4646
test('closes the dialog via the backdrop', async () => {
4747
await render(DialogComponent, {
48-
imports: [MatDialogModule, DialogContentDialogModule],
48+
imports: [MatDialogModule, DialogContentComponentModule],
4949
});
5050

5151
const openDialogButton = await screen.findByRole('button', { name: /open dialog/i });

apps/example-app/app/examples/15-dialog.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export class DialogComponent {
99
constructor(public dialog: MatDialog) {}
1010

1111
openDialog(): void {
12-
this.dialog.open(DialogContentDialogComponent);
12+
this.dialog.open(DialogContentComponent);
1313
}
1414
}
1515

@@ -24,15 +24,15 @@ export class DialogComponent {
2424
</div>
2525
`,
2626
})
27-
export class DialogContentDialogComponent {
28-
constructor(public dialogRef: MatDialogRef<DialogContentDialogComponent>) {}
27+
export class DialogContentComponent {
28+
constructor(public dialogRef: MatDialogRef<DialogContentComponent>) {}
2929

3030
cancel(): void {
3131
this.dialogRef.close();
3232
}
3333
}
3434

3535
@NgModule({
36-
declarations: [DialogContentDialogComponent],
36+
declarations: [DialogContentComponent],
3737
})
38-
export class DialogContentDialogModule {}
38+
export class DialogContentComponentModule {}

0 commit comments

Comments
 (0)