diff --git a/libs/frontend/root/src/config/app.config.ts b/libs/frontend/root/src/config/app.config.ts index 4320239..1c7e2fb 100644 --- a/libs/frontend/root/src/config/app.config.ts +++ b/libs/frontend/root/src/config/app.config.ts @@ -3,9 +3,12 @@ import { PLATFORM_ID, provideZoneChangeDetection, } from '@angular/core'; -import { provideRouter } from '@angular/router'; +import { provideRouter, withViewTransitions } from '@angular/router'; import { appRoutes } from './app.routes'; -import { provideClientHydration } from '@angular/platform-browser'; +import { + provideClientHydration, + withHttpTransferCacheOptions, +} from '@angular/platform-browser'; import { provideAnimationsAsync } from '@angular/platform-browser/animations/async'; import { provideHttpClient, withFetch } from '@angular/common/http'; import { BASE_URL } from '@app/frontend-utils'; @@ -13,9 +16,13 @@ import { isPlatformBrowser } from '@angular/common'; export const appConfig: ApplicationConfig = { providers: [ - provideClientHydration(), + provideClientHydration( + withHttpTransferCacheOptions({ + includePostRequests: true, + }), + ), provideZoneChangeDetection({ eventCoalescing: true }), - provideRouter(appRoutes), + provideRouter(appRoutes, withViewTransitions()), provideAnimationsAsync(), provideHttpClient(withFetch()), { diff --git a/libs/frontend/root/src/root/root.component.html b/libs/frontend/root/src/root/root.component.html index 5d5edfd..b9402da 100644 --- a/libs/frontend/root/src/root/root.component.html +++ b/libs/frontend/root/src/root/root.component.html @@ -3,7 +3,7 @@ -

Responsive App

+

Material + Nestjs!

diff --git a/libs/frontend/root/src/root/root.component.spec.ts b/libs/frontend/root/src/root/root.component.spec.ts index 7b49f0d..b9d58e9 100644 --- a/libs/frontend/root/src/root/root.component.spec.ts +++ b/libs/frontend/root/src/root/root.component.spec.ts @@ -1,12 +1,14 @@ import { provideHttpClient } from '@angular/common/http'; import { TestBed } from '@angular/core/testing'; import { RootComponent } from './root.component'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { RouterModule } from '@angular/router'; describe('RootComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ providers: [provideHttpClient()], - imports: [RootComponent], + imports: [RootComponent, NoopAnimationsModule, RouterModule.forRoot([])], }).compileComponents(); }); @@ -14,6 +16,8 @@ describe('RootComponent', () => { const fixture = TestBed.createComponent(RootComponent); fixture.detectChanges(); const compiled = fixture.nativeElement as HTMLElement; - expect(compiled.querySelector('h1')?.textContent).toContain('Welcome app'); + expect(compiled.querySelector('h1')?.textContent).toContain( + 'Material + Nestjs!', + ); }); });