Skip to content

Commit 548710c

Browse files
committed
Add a test for new issue creation where the fields are prepopulated.
1 parent 49ba659 commit 548710c

File tree

3 files changed

+1620
-0
lines changed

3 files changed

+1620
-0
lines changed

tests/corpus/_corpus-index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ export const CORPUS: Record<string, CorpusEntry> = {
1717
type: 'html',
1818
url: 'https://github.com/diffplug/gitcasso/issues/56',
1919
},
20+
gh_issue_new_populated: {
21+
description: 'a new issue wiht some fields filled out',
22+
type: 'html',
23+
url: 'https://github.com/diffplug/gitcasso/issues/new',
24+
},
2025
gh_issue_populated_comment: {
2126
description: 'comment text box has some text',
2227
type: 'html',

tests/corpus/gh_issue_new_populated.html

Lines changed: 1586 additions & 0 deletions
Large diffs are not rendered by default.

tests/lib/enhancers/github.test.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,35 @@ describe('github', () => {
114114
]
115115
`)
116116
})
117+
withCorpus('gh_issue_new_populated').it('has enhancement on initial page load', async () => {
118+
expect(enhancements(document, window)).toMatchInlineSnapshot(`
119+
[
120+
{
121+
"for": "id=:r34: name=null className=prc-Textarea-TextArea-13q4j focus-visible overtype-input",
122+
"spot": {
123+
"domain": "github.com",
124+
"slug": "diffplug/gitcasso",
125+
"title": "New issue title",
126+
"type": "GH_ISSUE_NEW_COMMENT",
127+
"unique_key": "github.com:diffplug/gitcasso:new",
128+
},
129+
"title": "New issue title",
130+
"upperDecoration": <React.Fragment>
131+
<span>
132+
New Issue
133+
</span>
134+
<span
135+
className="font-mono text-muted-foreground text-sm"
136+
>
137+
138+
diffplug/gitcasso
139+
140+
</span>
141+
</React.Fragment>,
142+
},
143+
]
144+
`)
145+
})
117146
withCorpus('gh_issue_populated_comment').it('should create the correct spot object', async () => {
118147
expect(enhancements(document, window)).toMatchInlineSnapshot(`
119148
[

0 commit comments

Comments
 (0)