Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
test: fixes volatile recording
Browse files Browse the repository at this point in the history
  • Loading branch information
moltar committed Sep 18, 2021
1 parent f89ad54 commit 6526384
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 21 deletions.
Expand Up @@ -8,7 +8,7 @@
},
"entries": [
{
"_id": "61055551b6bba2353de453ce691aaaee",
"_id": "f003c75b5d01c4497d79f6e7338d7f5e",
"_order": 0,
"cache": {},
"request": {
Expand All @@ -28,7 +28,7 @@
"value": "mws.amazonservices.ca"
}
],
"headersSize": 579,
"headersSize": 557,
"httpVersion": "HTTP/1.1",
"method": "GET",
"queryString": [
Expand All @@ -45,16 +45,16 @@
"value": "x"
},
{
"name": "QueryStartDateTime",
"value": "2021-03-11T00:00:00.000Z"
"name": "SellerId",
"value": "x"
},
{
"name": "SellerId",
"name": "SellerSkus.member.1",
"value": "x"
},
{
"name": "Signature",
"value": "6PMHHjicdFffAos2+jYcm7PQUHgCsBI9/C4ESSf4MzA="
"value": "qN0dk+Gwk8SEA7N30l77nQ+DAtl+zm5/wcPTQ9sImHk="
},
{
"name": "SignatureMethod",
Expand All @@ -66,21 +66,21 @@
},
{
"name": "Timestamp",
"value": "2021-09-18T06:29:25.302Z"
"value": "2021-09-18T06:51:34.780Z"
},
{
"name": "Version",
"value": "2010-10-01"
}
],
"url": "https://mws.amazonservices.ca/FulfillmentInventory/2010-10-01?AWSAccessKeyId=x&Action=ListInventorySupply&MWSAuthToken=x&QueryStartDateTime=2021-03-11T00%3A00%3A00.000Z&SellerId=x&Signature=6PMHHjicdFffAos2%2BjYcm7PQUHgCsBI9%2FC4ESSf4MzA%3D&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2021-09-18T06%3A29%3A25.302Z&Version=2010-10-01"
"url": "https://mws.amazonservices.ca/FulfillmentInventory/2010-10-01?AWSAccessKeyId=x&Action=ListInventorySupply&MWSAuthToken=x&SellerId=x&SellerSkus.member.1=x&Signature=qN0dk%2BGwk8SEA7N30l77nQ%2BDAtl%2Bzm5%2FwcPTQ9sImHk%3D&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2021-09-18T06%3A51%3A34.780Z&Version=2010-10-01"
},
"response": {
"bodySize": 372,
"bodySize": 572,
"content": {
"mimeType": "text/xml;charset=utf-8",
"size": 372,
"text": "<ListInventorySupplyResponse xmlns=\"http://mws.amazonaws.com/FulfillmentInventory/2010-10-01/\">\n <ListInventorySupplyResult>\n <MarketplaceId>A2EUQ1WTGCTBG2</MarketplaceId>\n <InventorySupplyList/>\n </ListInventorySupplyResult>\n <ResponseMetadata>\n <RequestId>c5f1f95c-26e5-4a39-975b-ec5b6e265b02</RequestId>\n </ResponseMetadata>\n</ListInventorySupplyResponse>\n"
"size": 572,
"text": "<ListInventorySupplyResponse xmlns=\"http://mws.amazonaws.com/FulfillmentInventory/2010-10-01/\">\n <ListInventorySupplyResult>\n <MarketplaceId>A2EUQ1WTGCTBG2</MarketplaceId>\n <InventorySupplyList>\n <member>\n <TotalSupplyQuantity>0</TotalSupplyQuantity>\n <InStockSupplyQuantity>0</InStockSupplyQuantity>\n <SellerSKU>x</SellerSKU>\n </member>\n </InventorySupplyList>\n </ListInventorySupplyResult>\n <ResponseMetadata>\n <RequestId>12f08191-a9ea-48cd-8c5d-362a46ff0155</RequestId>\n </ResponseMetadata>\n</ListInventorySupplyResponse>\n"
},
"cookies": [],
"headers": [
Expand All @@ -90,35 +90,35 @@
},
{
"name": "date",
"value": "Sat, 18 Sep 2021 06:29:25 GMT"
"value": "Sat, 18 Sep 2021 06:51:36 GMT"
},
{
"name": "content-type",
"value": "text/xml;charset=utf-8"
},
{
"name": "content-length",
"value": "372"
"value": "572"
},
{
"name": "connection",
"value": "close"
},
{
"name": "x-amz-rid",
"value": "9JMG3580W1EKWZJMSYZY"
"value": "Q4HCDWFNPEYQ4VZKV8QC"
},
{
"name": "x-mws-request-id",
"value": "c5f1f95c-26e5-4a39-975b-ec5b6e265b02"
"value": "12f08191-a9ea-48cd-8c5d-362a46ff0155"
},
{
"name": "x-mws-timestamp",
"value": "2021-09-18T06:29:25.419Z"
"value": "2021-09-18T06:51:36.102Z"
},
{
"name": "x-mws-response-context",
"value": "HbngUd/xkWSJlpIyfpWzJTcsXdYOw778/sn5TJp7Y1Al21Dsxp5H4BzbrCxsl5fYqlYlMI6GoBM="
"value": "Jwf0RFnYhH9U9t1R7jyKJhDQ0zO23vgEqOT1INE3E7flbBMQ9hUca+KZnb7aV3CUwJ7ZkUEl/no="
},
{
"name": "vary",
Expand All @@ -135,16 +135,16 @@
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2021-09-18T06:29:25.309Z",
"time": 159,
"startedDateTime": "2021-09-18T06:51:34.792Z",
"time": 1311,
"timings": {
"blocked": -1,
"connect": -1,
"dns": -1,
"receive": 0,
"send": 0,
"ssl": -1,
"wait": 159
"wait": 1311
}
}
],
Expand Down
11 changes: 10 additions & 1 deletion test/integration/fulfillment-inventory.test.ts
@@ -1,14 +1,23 @@
import { jestPollyConfigService } from '@scaleleap/jest-polly'

import { FulfillmentInventory, ListInventorySupplyRequestParameters } from '../../src'
import { Config } from './config'

jestPollyConfigService.config.matchRequestsBy = {
...jestPollyConfigService.config.matchRequestsBy,
url: {
query: false,
},
}

const httpClient = new Config().createHttpClient()

describe(`${FulfillmentInventory.name}`, () => {
it('should be able to get list of inventory supply', async () => {
expect.assertions(1)

const parameters: ListInventorySupplyRequestParameters = {
QueryStartDateTime: new Date('2021-03-11'),
SellerSkus: ['x'],
}

const fulfillmentInventory = new FulfillmentInventory(httpClient)
Expand Down

0 comments on commit 6526384

Please sign in to comment.