@@ -11,7 +11,7 @@ import {TestBed} from '@angular/core/testing';
1111import { Observable , of , Subject } from 'rxjs' ;
1212import { catchError , retry , scan , skip , take , toArray } from 'rxjs/operators' ;
1313
14- import { HttpDownloadProgressEvent , HttpErrorResponse , HttpHeaderResponse , HttpStatusCode } from '../public_api' ;
14+ import { HttpDownloadProgressEvent , HttpErrorResponse , HttpHeaderResponse , HttpParams , HttpStatusCode } from '../public_api' ;
1515import { FetchBackend , FetchFactory } from '../src/fetch' ;
1616
1717function trackEvents ( obs : Observable < any > ) : Promise < any [ ] > {
@@ -94,6 +94,16 @@ describe('FetchBackend', async () => {
9494 expect ( fetchMock . request . url ) . toBe ( '/test' ) ;
9595 } ) ;
9696
97+ it ( 'use query params from request' , ( ) => {
98+ const requestWithQuery = new HttpRequest ( 'GET' , '/test' , 'some body' , {
99+ params : new HttpParams ( { fromObject : { query : 'foobar' } } ) ,
100+ responseType : 'text' ,
101+ } ) ;
102+ callFetchAndFlush ( requestWithQuery ) ;
103+ expect ( fetchMock . request . method ) . toBe ( 'GET' ) ;
104+ expect ( fetchMock . request . url ) . toBe ( '/test?query=foobar' ) ;
105+ } ) ;
106+
97107 it ( 'sets outgoing body correctly' , ( ) => {
98108 callFetchAndFlush ( TEST_POST ) ;
99109 expect ( fetchMock . request . body ) . toBe ( 'some body' ) ;
0 commit comments