@@ -118,6 +118,112 @@ describe.each(["author", "user"])(
118118 }
119119) ;
120120
121+ it ( "linkifies bare issue references" , async ( ) => {
122+ expect (
123+ await getReleaseLine ( ...getChangeset ( "fixes #1234 and #5678" , data . commit ) )
124+ ) . toMatchInlineSnapshot ( `
125+ "
126+
127+ - [#1613](https://github.com/emotion-js/emotion/pull/1613) [\`a085003\`](https://github.com/emotion-js/emotion/commit/a085003) Thanks [@Andarist](https://github.com/Andarist)! - something
128+ fixes [#1234](https://github.com/emotion-js/emotion/issues/1234) and [#5678](https://github.com/emotion-js/emotion/issues/5678)"
129+ ` ) ;
130+ } ) ;
131+
132+ it ( "does not double-linkify existing markdown links" , async ( ) => {
133+ expect (
134+ await getReleaseLine (
135+ ...getChangeset (
136+ "see [#1234](https://github.com/emotion-js/emotion/issues/1234)" ,
137+ data . commit
138+ )
139+ )
140+ ) . toMatchInlineSnapshot ( `
141+ "
142+
143+ - [#1613](https://github.com/emotion-js/emotion/pull/1613) [\`a085003\`](https://github.com/emotion-js/emotion/commit/a085003) Thanks [@Andarist](https://github.com/Andarist)! - something
144+ see [#1234](https://github.com/emotion-js/emotion/issues/1234)"
145+ ` ) ;
146+ } ) ;
147+
148+ it ( "does not linkify issue-like refs inside link text" , async ( ) => {
149+ expect (
150+ await getReleaseLine (
151+ ...getChangeset ( "see [fix for #99](https://example.com)" , data . commit )
152+ )
153+ ) . toMatchInlineSnapshot ( `
154+ "
155+
156+ - [#1613](https://github.com/emotion-js/emotion/pull/1613) [\`a085003\`](https://github.com/emotion-js/emotion/commit/a085003) Thanks [@Andarist](https://github.com/Andarist)! - something
157+ see [fix for #99](https://example.com)"
158+ ` ) ;
159+ } ) ;
160+
161+ it ( "does not linkify when preceded by a word character" , async ( ) => {
162+ expect ( await getReleaseLine ( ...getChangeset ( "foo#123" , data . commit ) ) )
163+ . toMatchInlineSnapshot ( `
164+ "
165+
166+ - [#1613](https://github.com/emotion-js/emotion/pull/1613) [\`a085003\`](https://github.com/emotion-js/emotion/commit/a085003) Thanks [@Andarist](https://github.com/Andarist)! - something
167+ foo#123"
168+ ` ) ;
169+ } ) ;
170+
171+ it ( "does not linkify #0" , async ( ) => {
172+ expect ( await getReleaseLine ( ...getChangeset ( "see #0" , data . commit ) ) )
173+ . toMatchInlineSnapshot ( `
174+ "
175+
176+ - [#1613](https://github.com/emotion-js/emotion/pull/1613) [\`a085003\`](https://github.com/emotion-js/emotion/commit/a085003) Thanks [@Andarist](https://github.com/Andarist)! - something
177+ see #0"
178+ ` ) ;
179+ } ) ;
180+
181+ it ( "linkifies issue ref at the start of a line" , async ( ) => {
182+ expect ( await getReleaseLine ( ...getChangeset ( "#42 was fixed" , data . commit ) ) )
183+ . toMatchInlineSnapshot ( `
184+ "
185+
186+ - [#1613](https://github.com/emotion-js/emotion/pull/1613) [\`a085003\`](https://github.com/emotion-js/emotion/commit/a085003) Thanks [@Andarist](https://github.com/Andarist)! - something
187+ [#42](https://github.com/emotion-js/emotion/issues/42) was fixed"
188+ ` ) ;
189+ } ) ;
190+
191+ it ( "linkifies issue ref after punctuation" , async ( ) => {
192+ expect ( await getReleaseLine ( ...getChangeset ( "fixed (#99)" , data . commit ) ) )
193+ . toMatchInlineSnapshot ( `
194+ "
195+
196+ - [#1613](https://github.com/emotion-js/emotion/pull/1613) [\`a085003\`](https://github.com/emotion-js/emotion/commit/a085003) Thanks [@Andarist](https://github.com/Andarist)! - something
197+ fixed ([#99](https://github.com/emotion-js/emotion/issues/99))"
198+ ` ) ;
199+ } ) ;
200+
201+ it ( "handles mixed linked and bare refs" , async ( ) => {
202+ expect (
203+ await getReleaseLine (
204+ ...getChangeset (
205+ "fixes [#1](https://github.com/emotion-js/emotion/issues/1) and #2" ,
206+ data . commit
207+ )
208+ )
209+ ) . toMatchInlineSnapshot ( `
210+ "
211+
212+ - [#1613](https://github.com/emotion-js/emotion/pull/1613) [\`a085003\`](https://github.com/emotion-js/emotion/commit/a085003) Thanks [@Andarist](https://github.com/Andarist)! - something
213+ fixes [#1](https://github.com/emotion-js/emotion/issues/1) and [#2](https://github.com/emotion-js/emotion/issues/2)"
214+ ` ) ;
215+ } ) ;
216+
217+ it ( "linkifies issue ref followed by a dot" , async ( ) => {
218+ expect ( await getReleaseLine ( ...getChangeset ( "this fixes #42." , data . commit ) ) )
219+ . toMatchInlineSnapshot ( `
220+ "
221+
222+ - [#1613](https://github.com/emotion-js/emotion/pull/1613) [\`a085003\`](https://github.com/emotion-js/emotion/commit/a085003) Thanks [@Andarist](https://github.com/Andarist)! - something
223+ this fixes [#42](https://github.com/emotion-js/emotion/issues/42)."
224+ ` ) ;
225+ } ) ;
226+
121227it ( "with multiple authors" , async ( ) => {
122228 expect (
123229 await getReleaseLine (
0 commit comments