@@ -11,7 +11,8 @@ describe('github', () => {
1111 const textareas = document . querySelectorAll ( 'textarea' )
1212 expect ( textareas . length ) . toBe ( 2 )
1313 expect ( enhancers . tryToEnhance ( textareas [ 0 ] ! ) ) . toBeNull ( )
14- expect ( enhancers . tryToEnhance ( textareas [ 1 ] ! ) ?. spot ) . toMatchInlineSnapshot ( `
14+ const enhancedTextarea = enhancers . tryToEnhance ( textareas [ 1 ] ! )
15+ expect ( enhancedTextarea ?. spot ) . toMatchInlineSnapshot ( `
1516 {
1617 "domain": "github.com",
1718 "number": 517,
@@ -20,12 +21,28 @@ describe('github', () => {
2021 "unique_key": "github.com:diffplug/selfie:517",
2122 }
2223 ` )
24+ expect ( enhancedTextarea ?. enhancer . tableRow ( enhancedTextarea . spot ) ) . toMatchInlineSnapshot ( `
25+ <span>
26+ <span
27+ className="font-mono text-sm text-muted-foreground"
28+ >
29+ diffplug/selfie
30+ </span>
31+ <span
32+ className="ml-2 font-medium"
33+ >
34+ PR #
35+ 517
36+ </span>
37+ </span>
38+ ` )
2339 } )
2440 usingHar ( 'gh_issue' ) . it ( 'should create the correct spot object' , async ( ) => {
2541 const enhancers = new EnhancerRegistry ( )
2642 const textareas = document . querySelectorAll ( 'textarea' )
2743 expect ( textareas . length ) . toBe ( 1 )
28- expect ( enhancers . tryToEnhance ( textareas [ 0 ] ! ) ?. spot ) . toMatchInlineSnapshot ( `
44+ const enhancedTextarea = enhancers . tryToEnhance ( textareas [ 0 ] ! )
45+ expect ( enhancedTextarea ?. spot ) . toMatchInlineSnapshot ( `
2946 {
3047 "domain": "github.com",
3148 "number": 523,
@@ -34,5 +51,21 @@ describe('github', () => {
3451 "unique_key": "github.com:diffplug/selfie:523",
3552 }
3653 ` )
54+ // Test the tableRow method
55+ expect ( enhancedTextarea ?. enhancer . tableRow ( enhancedTextarea . spot ) ) . toMatchInlineSnapshot ( `
56+ <span>
57+ <span
58+ className="font-mono text-sm text-muted-foreground"
59+ >
60+ diffplug/selfie
61+ </span>
62+ <span
63+ className="ml-2 font-medium"
64+ >
65+ Issue #
66+ 523
67+ </span>
68+ </span>
69+ ` )
3770 } )
3871} )
0 commit comments