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

Commit

Permalink
feat: init MerchantFulfillment
Browse files Browse the repository at this point in the history
  • Loading branch information
justinemmanuelmercado committed Jun 30, 2020
1 parent 76ccb91 commit bf7754f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/unit/__snapshots__/merchant-fulfillment.test.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`merchant-fulfillment getServiceStatus returns a parsed model when the status response is valid 1`] = `
Array [
Object {
"Status": "GREEN",
"Timestamp": "2020-05-06T08:22:23.582Z",
},
Object {
"quotaMax": 1000,
"quotaRemaining": 999,
"quotaResetOn": 2020-04-06T10:22:23.582Z,
"requestId": "0",
"timestamp": 2020-05-06T09:22:23.582Z,
},
]
`;
20 changes: 20 additions & 0 deletions test/unit/merchant-fulfillment.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { ParsingError } from '../../src'
import { mockMwsFail, mockMwsServiceStatus, parsingError } from '../utils'

describe('merchant-fulfillment', () => {
describe('getServiceStatus', () => {
it('returns a parsed model when the status response is valid', async () => {
expect.assertions(1)

expect(await mockMwsServiceStatus.sellers.getServiceStatus()).toMatchSnapshot()
})

it('throws a parsing error when the status response is not valid', async () => {
expect.assertions(1)

await expect(() => mockMwsFail.sellers.getServiceStatus()).rejects.toStrictEqual(
new ParsingError(parsingError),
)
})
})
})

0 comments on commit bf7754f

Please sign in to comment.