@@ -5,8 +5,8 @@ import {HttpTestingController, provideHttpClientTesting} from '@angular/common/h
55import { DefaultService , Filter , provideApi } from '@swagger/typescript-angular-query-param-form'
66
77const ids : number [ ] = [ 4 , 5 ] ;
8- const filter : Filter = { name : 'John' , age : 37 } ;
9- const filterWithSpecialCharacters : Filter = { name : 'Éléonore &,|+' , age : 42 } ;
8+ const filter : Filter = { name : 'John' , age : 37 , nicknames : [ 'Joe' , 'Joey' ] } ;
9+ const filterWithSpecialCharacters : Filter = { name : 'Éléonore &,|+' , age : 42 , nicknames : [ 'Elé' , 'Ellie' ] } ;
1010const country : string = "Belgium" ;
1111
1212describe ( 'Form Query Param testing' , ( ) => {
@@ -36,13 +36,13 @@ describe('Form Query Param testing', () => {
3636
3737 it ( 'should separate the query parameter with ampersands (all set)' , async ( ) => {
3838 service . searchExplode ( ids , filter , country ) . subscribe ( ) ;
39- const req = httpTesting . expectOne ( 'http://localhost/search_explode?ids=4&ids=5&name=John&age=37&country=Belgium' ) ;
39+ const req = httpTesting . expectOne ( 'http://localhost/search_explode?ids=4&ids=5&name=John&age=37&nicknames=Joe&nicknames=Joey& country=Belgium' ) ;
4040 expect ( req . request . method ) . toEqual ( 'GET' ) ;
4141 } ) ;
4242
4343 it ( 'should separate the query parameter with ampersands (all set) - special characters' , async ( ) => {
4444 service . searchExplode ( ids , filterWithSpecialCharacters , country ) . subscribe ( ) ;
45- const req = httpTesting . expectOne ( 'http://localhost/search_explode?ids=4&ids=5&name=%C3%89l%C3%A9onore%20%26%2C%7C%2B&age=42&country=Belgium' ) ;
45+ const req = httpTesting . expectOne ( 'http://localhost/search_explode?ids=4&ids=5&name=%C3%89l%C3%A9onore%20%26%2C%7C%2B&age=42&nicknames=El%C3%A9&nicknames=Ellie& country=Belgium' ) ;
4646 expect ( req . request . method ) . toEqual ( 'GET' ) ;
4747 } ) ;
4848
@@ -70,7 +70,7 @@ describe('Form Query Param testing', () => {
7070 it ( 'should separate the query parameter with ampersands (object only)' , async ( ) => {
7171 service . searchExplode ( undefined , filter , undefined ) . subscribe ( ) ;
7272
73- const req = httpTesting . expectOne ( 'http://localhost/search_explode?name=John&age=37' ) ;
73+ const req = httpTesting . expectOne ( 'http://localhost/search_explode?name=John&age=37&nicknames=Joe&nicknames=Joey ' ) ;
7474 expect ( req . request . method ) . toEqual ( 'GET' ) ;
7575 } ) ;
7676
@@ -82,13 +82,13 @@ describe('Form Query Param testing', () => {
8282
8383 it ( 'should separate the query parameter with comma (all set)' , async ( ) => {
8484 service . searchNotExplode ( ids , filter , country ) . subscribe ( ) ;
85- const req = httpTesting . expectOne ( 'http://localhost/search_not_explode?ids=4,5&filter=name,John,age,37&country=Belgium' ) ;
85+ const req = httpTesting . expectOne ( 'http://localhost/search_not_explode?ids=4,5&filter=name,John,age,37,nicknames,Joe,Joey &country=Belgium' ) ;
8686 expect ( req . request . method ) . toEqual ( 'GET' ) ;
8787 } ) ;
8888
8989 it ( 'should separate the query parameter with comma (all set) - special characters' , async ( ) => {
9090 service . searchNotExplode ( ids , filterWithSpecialCharacters , country ) . subscribe ( ) ;
91- const req = httpTesting . expectOne ( 'http://localhost/search_not_explode?ids=4,5&filter=name,%C3%89l%C3%A9onore%20%26%2C%7C%2B,age,42&country=Belgium' ) ;
91+ const req = httpTesting . expectOne ( 'http://localhost/search_not_explode?ids=4,5&filter=name,%C3%89l%C3%A9onore%20%26%2C%7C%2B,age,42,nicknames,El%C3%A9,Ellie &country=Belgium' ) ;
9292 expect ( req . request . method ) . toEqual ( 'GET' ) ;
9393 } ) ;
9494
@@ -116,7 +116,7 @@ describe('Form Query Param testing', () => {
116116 it ( 'should separate the query parameter with comma (object only)' , async ( ) => {
117117 service . searchNotExplode ( undefined , filter , undefined ) . subscribe ( ) ;
118118
119- const req = httpTesting . expectOne ( 'http://localhost/search_not_explode?filter=name,John,age,37' ) ;
119+ const req = httpTesting . expectOne ( 'http://localhost/search_not_explode?filter=name,John,age,37,nicknames,Joe,Joey ' ) ;
120120 expect ( req . request . method ) . toEqual ( 'GET' ) ;
121121 } ) ;
122122
0 commit comments