Skip to content

Commit 95a273b

Browse files
authored
refactor(demo): convert misc to standalone (#4311)
1 parent 5bf87d5 commit 95a273b

File tree

9 files changed

+27
-56
lines changed

9 files changed

+27
-56
lines changed

apps/demo/src/app/app.module.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import { environment } from '../environments/environment';
2727
import { DemoCheckoutStepActionTypes } from './checkout/actions/checkout-step.actions';
2828
import { TemplateModule } from './core/template/template/template.module';
2929
import { DemoDriverModule } from './drivers/driver.module';
30-
import { NotFoundModule } from './misc/not-found/not-found.module';
3130
import { DemoIndicatorComponent } from './routing/indicator/indicator.component';
3231

3332
@NgModule({
@@ -51,7 +50,6 @@ import { DemoIndicatorComponent } from './routing/indicator/indicator.component'
5150
DemoIndicatorComponent,
5251
DemoCartRootModule,
5352
TemplateModule,
54-
NotFoundModule,
5553
DaffAuthorizeNetPaymentStateModule,
5654
DaffAuthorizeNetStateModule,
5755
DaffPaymentStateModule,

apps/demo/src/app/cart/components/cart-sidebar/cart-sidebar.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { NgModule } from '@angular/core';
44
import { DaffButtonModule } from '@daffodil/design/button';
55

66
import { CartSidebarComponent } from './cart-sidebar.component';
7-
import { HelpBoxModule } from '../../../misc/help-box/help-box.module';
7+
import { HelpBoxComponent } from '../../../misc/help-box/help-box.component';
88
import { CartTotalsModule } from '../cart-totals/cart-totals.module';
99
import { ProceedToCheckoutModule } from '../proceed-to-checkout/proceed-to-checkout.module';
1010

@@ -14,7 +14,7 @@ import { ProceedToCheckoutModule } from '../proceed-to-checkout/proceed-to-check
1414
CartTotalsModule,
1515
ProceedToCheckoutModule,
1616
DaffButtonModule,
17-
HelpBoxModule,
17+
HelpBoxComponent,
1818
],
1919
declarations: [
2020
CartSidebarComponent,

apps/demo/src/app/cart/components/cart-summary-wrapper/cart-summary-wrapper.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { NgModule } from '@angular/core';
44
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';
55

66
import { CartSummaryWrapperComponent } from './cart-summary-wrapper.component';
7-
import { HelpBoxModule } from '../../../misc/help-box/help-box.module';
7+
import { HelpBoxComponent } from '../../../misc/help-box/help-box.component';
88
import { CartSummaryModule } from '../cart-summary/cart-summary.module';
99
import { CartTotalsModule } from '../cart-totals/cart-totals.module';
1010

@@ -14,7 +14,7 @@ import { CartTotalsModule } from '../cart-totals/cart-totals.module';
1414
CartSummaryModule,
1515
CartTotalsModule,
1616
DaffLoadingIconModule,
17-
HelpBoxModule,
17+
HelpBoxComponent,
1818
],
1919
declarations: [
2020
CartSummaryWrapperComponent,

apps/demo/src/app/misc/help-box/help-box.component.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ describe('HelpBoxComponent', () => {
1212

1313
beforeEach(waitForAsync(() => {
1414
TestBed.configureTestingModule({
15-
declarations: [ HelpBoxComponent ],
15+
imports: [
16+
HelpBoxComponent,
17+
],
1618
})
1719
.compileComponents();
1820
}));

apps/demo/src/app/misc/help-box/help-box.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ import { Component } from '@angular/core';
44
selector: 'demo-help-box',
55
templateUrl: './help-box.component.html',
66
styleUrls: ['./help-box.component.scss'],
7-
standalone: false,
87
})
98
export class HelpBoxComponent {}

apps/demo/src/app/misc/help-box/help-box.module.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

apps/demo/src/app/misc/not-found/not-found.component.spec.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
import {
2-
Component,
3-
DebugElement,
4-
} from '@angular/core';
1+
import { DebugElement } from '@angular/core';
52
import {
63
waitForAsync,
74
ComponentFixture,
85
TestBed,
96
} from '@angular/core/testing';
107
import { By } from '@angular/platform-browser';
8+
import { provideRouter } from '@angular/router';
9+
import { EffectsModule } from '@ngrx/effects';
10+
import { StoreModule } from '@ngrx/store';
11+
12+
import { DaffProductTestingDriverModule } from '@daffodil/product/driver/testing';
13+
import { DaffProductStateTestingModule } from '@daffodil/product/state/testing';
1114

1215
import { NotFoundComponent } from './not-found.component';
1316

14-
@Component({
15-
selector: 'demo-best-sellers', template: '',
16-
standalone: false,
17-
})
18-
class MockBestSellersComponent {}
1917

2018
describe('NotFoundComponent', () => {
2119
let component: NotFoundComponent;
@@ -24,9 +22,15 @@ describe('NotFoundComponent', () => {
2422

2523
beforeEach(waitForAsync(() => {
2624
TestBed.configureTestingModule({
27-
declarations: [
25+
imports: [
2826
NotFoundComponent,
29-
MockBestSellersComponent,
27+
DaffProductStateTestingModule,
28+
DaffProductTestingDriverModule.forRoot(),
29+
StoreModule.forRoot({}),
30+
EffectsModule.forRoot([]),
31+
],
32+
providers: [
33+
provideRouter([]),
3034
],
3135
})
3236
.compileComponents();

apps/demo/src/app/misc/not-found/not-found.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import { Component } from '@angular/core';
22

3+
import { BestSellersComponent } from '../../product/containers/best-sellers/best-sellers.component';
4+
35
@Component({
46
selector: 'demo-not-found',
57
templateUrl: './not-found.component.html',
68
styleUrls: ['./not-found.component.scss'],
7-
standalone: false,
9+
imports: [
10+
BestSellersComponent,
11+
],
812
})
913
export class NotFoundComponent {
1014
NOT_FOUND_TEXT = 'this page cannot be found: 404 error';

apps/demo/src/app/misc/not-found/not-found.module.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)