@@ -4,7 +4,6 @@ import { describe, expect, it } from 'vitest';
44import {
55 generateRequestOptionsArguments ,
66 getHookOptions ,
7- getHttpFunctionQueryProps ,
87 getQueryArgumentsRequestType ,
98 getQueryHeader ,
109 getQueryOptions ,
@@ -118,102 +117,6 @@ describe('getQueryHeader', () => {
118117 } ) ;
119118} ) ;
120119
121- describe ( 'getHttpFunctionQueryProps' , ( ) => {
122- describe ( 'without mutator (native Angular)' , ( ) => {
123- it ( 'should prefix with http for Angular httpClient' , ( ) => {
124- const result = getHttpFunctionQueryProps (
125- false ,
126- OutputHttpClient . ANGULAR ,
127- 'params' ,
128- true ,
129- false ,
130- ) ;
131- expect ( result ) . toBe ( 'http, params' ) ;
132- } ) ;
133-
134- it ( 'should return just http when no query properties for Angular' , ( ) => {
135- const result = getHttpFunctionQueryProps (
136- false ,
137- OutputHttpClient . ANGULAR ,
138- '' ,
139- true ,
140- false ,
141- ) ;
142- expect ( result ) . toBe ( 'http' ) ;
143- } ) ;
144-
145- it ( 'should prefix with http when isAngular is true' , ( ) => {
146- const result = getHttpFunctionQueryProps (
147- false ,
148- OutputHttpClient . AXIOS ,
149- 'params' ,
150- true ,
151- false ,
152- ) ;
153- expect ( result ) . toBe ( 'http, params' ) ;
154- } ) ;
155- } ) ;
156-
157- describe ( 'with mutator (custom Angular mutator)' , ( ) => {
158- it ( 'should NOT prefix with http when mutator is used' , ( ) => {
159- const result = getHttpFunctionQueryProps (
160- false ,
161- OutputHttpClient . ANGULAR ,
162- 'params' ,
163- true ,
164- true ,
165- ) ;
166- expect ( result ) . toBe ( 'params' ) ;
167- } ) ;
168-
169- it ( 'should return empty string when no query properties and mutator is used' , ( ) => {
170- const result = getHttpFunctionQueryProps (
171- false ,
172- OutputHttpClient . ANGULAR ,
173- '' ,
174- true ,
175- true ,
176- ) ;
177- expect ( result ) . toBe ( '' ) ;
178- } ) ;
179-
180- it ( 'should NOT prefix with http even when isAngular is true if mutator is used' , ( ) => {
181- const result = getHttpFunctionQueryProps (
182- false ,
183- OutputHttpClient . AXIOS ,
184- 'params' ,
185- true ,
186- true ,
187- ) ;
188- expect ( result ) . toBe ( 'params' ) ;
189- } ) ;
190- } ) ;
191-
192- describe ( 'non-Angular clients' , ( ) => {
193- it ( 'should return query properties without http prefix for axios' , ( ) => {
194- const result = getHttpFunctionQueryProps (
195- false ,
196- OutputHttpClient . AXIOS ,
197- 'params' ,
198- false ,
199- false ,
200- ) ;
201- expect ( result ) . toBe ( 'params' ) ;
202- } ) ;
203-
204- it ( 'should return query properties without http prefix for fetch' , ( ) => {
205- const result = getHttpFunctionQueryProps (
206- false ,
207- OutputHttpClient . FETCH ,
208- 'params' ,
209- false ,
210- false ,
211- ) ;
212- expect ( result ) . toBe ( 'params' ) ;
213- } ) ;
214- } ) ;
215- } ) ;
216-
217120describe ( 'getQueryOptions' , ( ) => {
218121 const mockMutator = {
219122 name : 'customInstance' ,
0 commit comments