99import { DOCUMENT } from '@angular/common' ;
1010import { HttpClient , provideHttpClient } from '@angular/common/http' ;
1111import { HttpTestingController , provideHttpClientTesting } from '@angular/common/http/testing' ;
12- import { ApplicationRef , Component , Injectable } from '@angular/core' ;
12+ import { ApplicationRef , Component , Injectable , ɵSSR_CONTENT_INTEGRITY_MARKER as SSR_CONTENT_INTEGRITY_MARKER } from '@angular/core' ;
1313import { TestBed } from '@angular/core/testing' ;
1414import { withBody } from '@angular/private/testing' ;
1515import { BehaviorSubject } from 'rxjs' ;
@@ -37,23 +37,24 @@ describe('provideClientHydration', () => {
3737 }
3838
3939 describe ( 'default' , ( ) => {
40- beforeEach ( withBody ( '<test-hydrate-app></test-hydrate-app>' , ( ) => {
41- TestBed . resetTestingModule ( ) ;
40+ beforeEach ( withBody (
41+ `<!--${ SSR_CONTENT_INTEGRITY_MARKER } --><test-hydrate-app></test-hydrate-app>` , ( ) => {
42+ TestBed . resetTestingModule ( ) ;
4243
43- TestBed . configureTestingModule ( {
44- declarations : [ SomeComponent ] ,
45- providers : [
46- { provide : DOCUMENT , useFactory : ( ) => document } ,
47- { provide : ApplicationRef , useClass : ApplicationRefPatched } ,
48- provideClientHydration ( ) ,
49- provideHttpClient ( ) ,
50- provideHttpClientTesting ( ) ,
51- ] ,
52- } ) ;
44+ TestBed . configureTestingModule ( {
45+ declarations : [ SomeComponent ] ,
46+ providers : [
47+ { provide : DOCUMENT , useFactory : ( ) => document } ,
48+ { provide : ApplicationRef , useClass : ApplicationRefPatched } ,
49+ provideClientHydration ( ) ,
50+ provideHttpClient ( ) ,
51+ provideHttpClientTesting ( ) ,
52+ ] ,
53+ } ) ;
5354
54- const appRef = TestBed . inject ( ApplicationRef ) ;
55- appRef . bootstrap ( SomeComponent ) ;
56- } ) ) ;
55+ const appRef = TestBed . inject ( ApplicationRef ) ;
56+ appRef . bootstrap ( SomeComponent ) ;
57+ } ) ) ;
5758
5859 it ( `should use cached HTTP calls` , ( ) => {
5960 makeRequestAndExpectOne ( '/test-1' , 'foo' ) ;
@@ -63,23 +64,24 @@ describe('provideClientHydration', () => {
6364 } ) ;
6465
6566 describe ( 'withNoHttpTransferCache' , ( ) => {
66- beforeEach ( withBody ( '<test-hydrate-app></test-hydrate-app>' , ( ) => {
67- TestBed . resetTestingModule ( ) ;
67+ beforeEach ( withBody (
68+ `<!--${ SSR_CONTENT_INTEGRITY_MARKER } --><test-hydrate-app></test-hydrate-app>` , ( ) => {
69+ TestBed . resetTestingModule ( ) ;
6870
69- TestBed . configureTestingModule ( {
70- declarations : [ SomeComponent ] ,
71- providers : [
72- { provide : DOCUMENT , useFactory : ( ) => document } ,
73- { provide : ApplicationRef , useClass : ApplicationRefPatched } ,
74- provideClientHydration ( withNoHttpTransferCache ( ) ) ,
75- provideHttpClient ( ) ,
76- provideHttpClientTesting ( ) ,
77- ] ,
78- } ) ;
71+ TestBed . configureTestingModule ( {
72+ declarations : [ SomeComponent ] ,
73+ providers : [
74+ { provide : DOCUMENT , useFactory : ( ) => document } ,
75+ { provide : ApplicationRef , useClass : ApplicationRefPatched } ,
76+ provideClientHydration ( withNoHttpTransferCache ( ) ) ,
77+ provideHttpClient ( ) ,
78+ provideHttpClientTesting ( ) ,
79+ ] ,
80+ } ) ;
7981
80- const appRef = TestBed . inject ( ApplicationRef ) ;
81- appRef . bootstrap ( SomeComponent ) ;
82- } ) ) ;
82+ const appRef = TestBed . inject ( ApplicationRef ) ;
83+ appRef . bootstrap ( SomeComponent ) ;
84+ } ) ) ;
8385
8486 it ( `should not cached HTTP calls` , ( ) => {
8587 makeRequestAndExpectOne ( '/test-1' , 'foo' ) ;
0 commit comments