Skip to content

Commit c338684

Browse files
committed
Add a test for issues too.
1 parent b6961f1 commit c338684

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

browser-extension/tests/lib/enhancers/github.test.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ expect
66
import { EnhancerRegistry } from '../../../src/lib/registries'
77

88
describe('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
})

0 commit comments

Comments
 (0)