File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
browser-extension/tests/lib/enhancers Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 66import { EnhancerRegistry } from '../../../src/lib/registries'
77
88describe ( 'github' , ( ) => {
9- usingHar ( 'gh_pr' ) . it ( 'should identify gh_pr textarea and create proper spot object' , async ( ) => {
9+ usingHar ( 'gh_pr' ) . it ( 'should create the correct spot object' , async ( ) => {
1010 const enhancers = new EnhancerRegistry ( )
1111 const textareas = document . querySelectorAll ( 'textarea' )
1212 expect ( textareas . length ) . toBe ( 2 )
@@ -21,4 +21,18 @@ describe('github', () => {
2121 }
2222 ` )
2323 } )
24+ usingHar ( 'gh_issue' ) . it ( 'should create the correct spot object' , async ( ) => {
25+ const enhancers = new EnhancerRegistry ( )
26+ const textareas = document . querySelectorAll ( 'textarea' )
27+ expect ( textareas . length ) . toBe ( 1 )
28+ expect ( enhancers . tryToEnhance ( textareas [ 0 ] ! ) ?. spot ) . toMatchInlineSnapshot ( `
29+ {
30+ "domain": "github.com",
31+ "number": 523,
32+ "slug": "diffplug/selfie",
33+ "type": "GH_ISSUE_ADD_COMMENT",
34+ "unique_key": "github.com:diffplug/selfie:523",
35+ }
36+ ` )
37+ } )
2438} )
You can’t perform that action at this time.
0 commit comments