Skip to content
This repository was archived by the owner on May 29, 2025. It is now read-only.

Commit 20b0b4f

Browse files
committed
Add test
1 parent 8be9c4c commit 20b0b4f

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

plugins/importer-curl/tests/index.test.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,35 @@ describe('importer-curl', () => {
172172
});
173173
});
174174

175+
test('Imports combined data params as form url-encoded', () => {
176+
expect(convertCurl(`curl -d 'a=aaa&b=bbb&c' https://yaak.app`)).toEqual({
177+
resources: {
178+
workspaces: [baseWorkspace()],
179+
httpRequests: [
180+
baseRequest({
181+
method: 'POST',
182+
url: 'https://yaak.app',
183+
bodyType: 'application/x-www-form-urlencoded',
184+
headers: [
185+
{
186+
name: 'Content-Type',
187+
value: 'application/x-www-form-urlencoded',
188+
enabled: true,
189+
},
190+
],
191+
body: {
192+
form: [
193+
{ name: 'a', value: 'aaa', enabled: true },
194+
{ name: 'b', value: 'bbb', enabled: true },
195+
{ name: 'c', value: '', enabled: true },
196+
],
197+
},
198+
}),
199+
],
200+
},
201+
});
202+
});
203+
175204
test('Imports data params as text', () => {
176205
expect(
177206
convertCurl('curl -H Content-Type:text/plain -d a -d b -d c=ccc https://yaak.app'),

0 commit comments

Comments
 (0)