Skip to content

Commit

Permalink
Add test case for JIRA ticket to full URL (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
grubbins authored and hanzei committed Jan 20, 2020
1 parent 701830d commit 542fab8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion server/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ func TestSpecialCases(t *testing.T) {
Pattern: "(Example)",
Template: "[Example](https://example.com)",
}, Link{
Pattern: "(https://mattermost.atlassian.net/browse/)(MM)(-)(?P<jira_id>\\d+)",
Pattern: "MM-(?P<jira_id>\\d+)",
Template: "[MM-$jira_id](https://mattermost.atlassian.net/browse/MM-$jira_id)",
}, Link{
Pattern: "https://mattermost.atlassian.net/browse/MM-(?P<jira_id>\\d+)",
Template: "[MM-$jira_id](https://mattermost.atlassian.net/browse/MM-$jira_id)",
}, Link{
Pattern: "(foo!bar)",
Expand Down Expand Up @@ -209,6 +212,9 @@ func TestSpecialCases(t *testing.T) {
}, {
"text https://mattermost.atlassian.net/browse/MM-12345 other text",
"text [MM-12345](https://mattermost.atlassian.net/browse/MM-12345) other text",
}, {
"check out MM-12345 too",
"check out [MM-12345](https://mattermost.atlassian.net/browse/MM-12345) too",
},
}

Expand Down

0 comments on commit 542fab8

Please sign in to comment.