Skip to content

Commit

Permalink
test(jira): add failing test for bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tagoro9 committed Jul 9, 2020
1 parent b7f7d76 commit 60a4b4d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/issue-tracker/Jira.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,19 @@ describe('jira', () => {
}
});
});

describe('getIssue', () => {
test('gets and transforms the issue from Jira', async () => {
const jiraIssue = data.createJiraIssue({
summary: `Issue with a lot of characters "$&'*,:;<>?@[]\`~‘’“”`,
});
httpClientMocks.get.mockReturnValue(of(data.createHttpResponse(jiraIssue)));
const issue = await jira.getIssue(jiraIssue.key).toPromise();
expect(issue.sanitizedSummary).not.toContain(':');
expect(issue).toMatchSnapshot();
expect(httpClientMocks.get).toHaveBeenCalledWith(`/issue/${jiraIssue.key}`, {
qs: { expand: 'transitions, renderedFields' },
});
});
});
});

0 comments on commit 60a4b4d

Please sign in to comment.