Skip to content

Commit 2fb9278

Browse files
author
ntwigg
committed
Fixup and simplify tests.
1 parent a7420f4 commit 2fb9278

File tree

3 files changed

+0
-29
lines changed

3 files changed

+0
-29
lines changed

browser-extension/src/datamodel/handlers/github-handler.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ export class GitHubHandler implements CommentEnhancer<GitHubContext> {
7373
unique_key += ':new'
7474
}
7575

76-
7776
const context: GitHubContext = {
7877
domain: window.location.hostname,
7978
number,

browser-extension/tests/datamodel/handlers/__snapshots__/github-handler.test.ts.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
exports[`GitHubHandler > should create correct GitHubContext spot for PR comment > github-pr-517-spot 1`] = `
44
{
5-
"commentId": undefined,
65
"domain": "github.com",
76
"number": 517,
87
"slug": "diffplug/selfie",

browser-extension/tests/datamodel/handlers/github-handler.test.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ describe('GitHubHandler', () => {
6767

6868
// Also verify specific expected values
6969
expect(enhancedTextarea?.spot).toMatchObject({
70-
commentId: undefined,
7170
domain: 'github.com',
7271
number: 517,
7372
slug: 'diffplug/selfie',
@@ -76,32 +75,6 @@ describe('GitHubHandler', () => {
7675
})
7776
})
7877

79-
it('should handle multiple textareas on the same page', () => {
80-
// Create a second textarea for inline code comments
81-
const codeCommentTextarea = document.createElement('textarea')
82-
codeCommentTextarea.className = 'form-control js-suggester-field'
83-
84-
const inlineForm = document.createElement('div')
85-
inlineForm.className = 'js-inline-comment-form'
86-
inlineForm.appendChild(codeCommentTextarea)
87-
document.body.appendChild(inlineForm)
88-
89-
// Test both textareas
90-
const mainCommentEnhanced = enhancers.tryToEnhance(mockTextarea)
91-
const codeCommentEnhanced = enhancers.tryToEnhance(codeCommentTextarea)
92-
93-
expect(mainCommentEnhanced?.spot.type).toBe('GH_PR_ADD_COMMENT')
94-
expect(codeCommentEnhanced?.spot.type).toBe('GH_PR_CODE_COMMENT')
95-
96-
// Register both
97-
if (mainCommentEnhanced) enhancedTextareas.register(mainCommentEnhanced)
98-
if (codeCommentEnhanced) enhancedTextareas.register(codeCommentEnhanced)
99-
100-
// Verify both are registered
101-
expect(enhancedTextareas.get(mockTextarea)).toBeTruthy()
102-
expect(enhancedTextareas.get(codeCommentTextarea)).toBeTruthy()
103-
})
104-
10578
it('should not enhance textarea on non-GitHub pages', () => {
10679
// Change location to non-GitHub site
10780
Object.defineProperty(window, 'location', {

0 commit comments

Comments
 (0)