Commit 99d42aed authored by Tom Quirk's avatar Tom Quirk

Address maintainer feedback

- use toMatchObject to test props
parent c4db61f8
...@@ -96,10 +96,12 @@ describe('JiraIssuesListRoot', () => { ...@@ -96,10 +96,12 @@ describe('JiraIssuesListRoot', () => {
const issuableList = findIssuableList(); const issuableList = findIssuableList();
const issuablesProp = issuableList.props('issuables'); const issuablesProp = issuableList.props('issuables');
expect(issuableList.props('currentPage')).toBe(resolvedValue.headers['x-page']); expect(issuableList.props()).toMatchObject({
expect(issuableList.props('previousPage')).toBe(resolvedValue.headers['x-page'] - 1); currentPage: resolvedValue.headers['x-page'],
expect(issuableList.props('nextPage')).toBe(resolvedValue.headers['x-page'] + 1); previousPage: resolvedValue.headers['x-page'] - 1,
expect(issuableList.props('totalItems')).toBe(resolvedValue.headers['x-total']); nextPage: resolvedValue.headers['x-page'] + 1,
totalItems: resolvedValue.headers['x-total'],
});
expect(issuablesProp).toHaveLength(mockJiraIssues.length); expect(issuablesProp).toHaveLength(mockJiraIssues.length);
const firstIssue = convertObjectPropsToCamelCase(mockJiraIssues[0], { deep: true }); const firstIssue = convertObjectPropsToCamelCase(mockJiraIssues[0], { deep: true });
...@@ -201,9 +203,11 @@ describe('JiraIssuesListRoot', () => { ...@@ -201,9 +203,11 @@ describe('JiraIssuesListRoot', () => {
with_labels_details: true, with_labels_details: true,
}, },
}); });
expect(issuableList.props('currentPage')).toBe(mockPage); expect(issuableList.props()).toMatchObject({
expect(issuableList.props('previousPage')).toBe(mockPage - 1); currentPage: mockPage,
expect(issuableList.props('nextPage')).toBe(mockPage + 1); previousPage: mockPage - 1,
nextPage: mockPage + 1,
});
}); });
it('"sort" event executes GET request correctly', async () => { it('"sort" event executes GET request correctly', async () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment