This repository has been archived by the owner on Feb 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: made tests for getFeedSubmissionList
- Loading branch information
1 parent
501283c
commit 1c143e8
Showing
2 changed files
with
34 additions
and
5 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
test/unit/__fixtures__/feeds_get_feed_submissison_list.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<GetFeedSubmissionListResponse | ||
xmlns="http://mws.amazonaws.com/doc/2009-01-01/"> | ||
<GetFeedSubmissionListResult> | ||
<NextToken>2YgYW55IGNhcm5hbCBwbGVhc3VyZS4=</NextToken> | ||
<HasNext>true</HasNext> | ||
<FeedSubmissionInfo> | ||
<FeedSubmissionId>2291326430</FeedSubmissionId> | ||
<FeedType>_POST_PRODUCT_DATA_</FeedType> | ||
<SubmittedDate>2009-02-20T02:10:35+00:00</SubmittedDate> | ||
<FeedProcessingStatus>_SUBMITTED_</FeedProcessingStatus> | ||
</FeedSubmissionInfo> | ||
</GetFeedSubmissionListResult> | ||
<ResponseMetadata> | ||
<RequestId>1105b931-6f1c-4480-8e97-f3b467840a9e</RequestId> | ||
</ResponseMetadata> | ||
</GetFeedSubmissionListResponse> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
// import { ParsingError } from '../../src' | ||
// import { mockMwsFail, mockMwsServiceStatus, parsingError } from '../utils' | ||
import { ParsingError } from '../../src' | ||
import { createMockHttpClient, mockMwsFail, parsingError } from '../utils' | ||
|
||
describe('feeds', () => { | ||
it('is true', () => { | ||
expect.hasAssertions() | ||
expect(true).toBe(true) | ||
describe('getFeedSubmissionList', () => { | ||
it('returns a next token and feed submission info if succesful', async () => { | ||
expect.assertions(1) | ||
|
||
const mockGetFeedSubmissionList = createMockHttpClient('feeds_get_feed_submission_list') | ||
|
||
expect(await mockGetFeedSubmissionList.feeds.getFeedSubmissionList()).toMatchSnapshot() | ||
}) | ||
|
||
it('throws a parsing error when the response is not valid', async () => { | ||
expect.assertions(1) | ||
|
||
await expect(() => mockMwsFail.feeds.getFeedSubmissionList()()).rejects.toStrictEqual( | ||
new ParsingError(parsingError), | ||
) | ||
}) | ||
}) | ||
}) |