mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-22 16:48:30 +02:00
Add test
This commit is contained in:
@@ -172,6 +172,35 @@ describe('importer-curl', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('Imports combined data params as form url-encoded', () => {
|
||||||
|
expect(convertCurl(`curl -d 'a=aaa&b=bbb&c' https://yaak.app`)).toEqual({
|
||||||
|
resources: {
|
||||||
|
workspaces: [baseWorkspace()],
|
||||||
|
httpRequests: [
|
||||||
|
baseRequest({
|
||||||
|
method: 'POST',
|
||||||
|
url: 'https://yaak.app',
|
||||||
|
bodyType: 'application/x-www-form-urlencoded',
|
||||||
|
headers: [
|
||||||
|
{
|
||||||
|
name: 'Content-Type',
|
||||||
|
value: 'application/x-www-form-urlencoded',
|
||||||
|
enabled: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
body: {
|
||||||
|
form: [
|
||||||
|
{ name: 'a', value: 'aaa', enabled: true },
|
||||||
|
{ name: 'b', value: 'bbb', enabled: true },
|
||||||
|
{ name: 'c', value: '', enabled: true },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
test('Imports data params as text', () => {
|
test('Imports data params as text', () => {
|
||||||
expect(
|
expect(
|
||||||
convertCurl('curl -H Content-Type:text/plain -d a -d b -d c=ccc https://yaak.app'),
|
convertCurl('curl -H Content-Type:text/plain -d a -d b -d c=ccc https://yaak.app'),
|
||||||
|
|||||||
Reference in New Issue
Block a user