@@ -3,6 +3,7 @@ import { PullRequestCommenter } from "@/features/hooks/domain"
33test ( "It adds comment when none exist" , async ( ) => {
44 let didAddComment = false
55 const sut = new PullRequestCommenter ( {
6+ domain : "https://example.com" ,
67 siteName : "Demo Docs" ,
78 repositoryNameSuffix : "-openapi" ,
89 projectConfigurationFilename : ".demo-docs.yml" ,
@@ -30,7 +31,6 @@ test("It adds comment when none exist", async () => {
3031 }
3132 } )
3233 await sut . commentPullRequest ( {
33- hostURL : "https://localhost:3000" ,
3434 appInstallationId : 1234 ,
3535 pullRequestNumber : 42 ,
3636 repositoryOwner : "acme" ,
@@ -44,6 +44,7 @@ test("It adds comment containing list of changed files", async () => {
4444 let didAddComment = false
4545 let commentBody : string | undefined
4646 const sut = new PullRequestCommenter ( {
47+ domain : "https://example.com" ,
4748 siteName : "Demo Docs" ,
4849 repositoryNameSuffix : "-openapi" ,
4950 projectConfigurationFilename : ".demo-docs.yml" ,
@@ -75,7 +76,6 @@ test("It adds comment containing list of changed files", async () => {
7576 }
7677 } )
7778 await sut . commentPullRequest ( {
78- hostURL : "https://localhost:3000" ,
7979 appInstallationId : 1234 ,
8080 pullRequestNumber : 42 ,
8181 repositoryOwner : "acme" ,
@@ -91,6 +91,7 @@ test("It adds comment containing list of changed files", async () => {
9191test ( "It skips adding comment when no YAML files were found in the PR" , async ( ) => {
9292 let didAddComment = false
9393 const sut = new PullRequestCommenter ( {
94+ domain : "https://example.com" ,
9495 siteName : "Demo Docs" ,
9596 repositoryNameSuffix : "-openapi" ,
9697 projectConfigurationFilename : ".demo-docs.yml" ,
@@ -118,7 +119,6 @@ test("It skips adding comment when no YAML files were found in the PR", async ()
118119 }
119120 } )
120121 await sut . commentPullRequest ( {
121- hostURL : "https://localhost:3000" ,
122122 appInstallationId : 1234 ,
123123 pullRequestNumber : 42 ,
124124 repositoryOwner : "acme" ,
@@ -131,6 +131,7 @@ test("It skips adding comment when no YAML files were found in the PR", async ()
131131test ( "It updates comment when one already exists" , async ( ) => {
132132 let didUpdateComment = false
133133 const sut = new PullRequestCommenter ( {
134+ domain : "https://example.com" ,
134135 siteName : "Demo Docs" ,
135136 repositoryNameSuffix : "-openapi" ,
136137 projectConfigurationFilename : ".demo-docs.yml" ,
@@ -165,7 +166,6 @@ test("It updates comment when one already exists", async () => {
165166 }
166167 } )
167168 await sut . commentPullRequest ( {
168- hostURL : "https://localhost:3000" ,
169169 appInstallationId : 1234 ,
170170 pullRequestNumber : 42 ,
171171 repositoryOwner : "acme" ,
@@ -179,6 +179,7 @@ test("It skips updating comment when the body has not changed", async () => {
179179 let addedCommentBody : string | undefined
180180 let didUpdateComment = false
181181 const sut = new PullRequestCommenter ( {
182+ domain : "https://example.com" ,
182183 siteName : "Demo Docs" ,
183184 repositoryNameSuffix : "-openapi" ,
184185 projectConfigurationFilename : ".demo-docs.yml" ,
@@ -219,7 +220,6 @@ test("It skips updating comment when the body has not changed", async () => {
219220 } )
220221 // Add a comment.
221222 await sut . commentPullRequest ( {
222- hostURL : "https://localhost:3000" ,
223223 appInstallationId : 1234 ,
224224 pullRequestNumber : 42 ,
225225 repositoryOwner : "acme" ,
@@ -228,7 +228,6 @@ test("It skips updating comment when the body has not changed", async () => {
228228 } )
229229 // Attempt to update a comment. This is skipped because the body has not changed.
230230 await sut . commentPullRequest ( {
231- hostURL : "https://localhost:3000" ,
232231 appInstallationId : 1234 ,
233232 pullRequestNumber : 42 ,
234233 repositoryOwner : "acme" ,
@@ -245,6 +244,7 @@ test("It updates comment to remove file list when all relevant file changes were
245244 let addedCommentBody : string | undefined
246245 let updatedCommentBody : string | undefined
247246 const sut = new PullRequestCommenter ( {
247+ domain : "https://example.com" ,
248248 siteName : "Demo Docs" ,
249249 repositoryNameSuffix : "-openapi" ,
250250 projectConfigurationFilename : ".demo-docs.yml" ,
@@ -292,7 +292,6 @@ test("It updates comment to remove file list when all relevant file changes were
292292 } )
293293 // Add a comment.
294294 await sut . commentPullRequest ( {
295- hostURL : "https://localhost:3000" ,
296295 appInstallationId : 1234 ,
297296 pullRequestNumber : 42 ,
298297 repositoryOwner : "acme" ,
@@ -301,7 +300,6 @@ test("It updates comment to remove file list when all relevant file changes were
301300 } )
302301 // Attempt to update a comment. This is skipped because the body has not changed.
303302 await sut . commentPullRequest ( {
304- hostURL : "https://localhost:3000" ,
305303 appInstallationId : 1234 ,
306304 pullRequestNumber : 42 ,
307305 repositoryOwner : "acme" ,
@@ -320,6 +318,7 @@ test("It adds comment if only project configuration was edited", async () => {
320318 let didAddComment = false
321319 let commentBody : string | undefined
322320 const sut = new PullRequestCommenter ( {
321+ domain : "https://example.com" ,
323322 siteName : "Demo Docs" ,
324323 repositoryNameSuffix : "-openapi" ,
325324 projectConfigurationFilename : ".demo-docs.yml" ,
@@ -358,7 +357,6 @@ test("It adds comment if only project configuration was edited", async () => {
358357 }
359358 } )
360359 await sut . commentPullRequest ( {
361- hostURL : "https://localhost:3000" ,
362360 appInstallationId : 1234 ,
363361 pullRequestNumber : 42 ,
364362 repositoryOwner : "acme" ,
@@ -374,6 +372,7 @@ test("It ignores files starting with a dot", async () => {
374372 let didAddComment = false
375373 let commentBody : string | undefined
376374 const sut = new PullRequestCommenter ( {
375+ domain : "https://example.com" ,
377376 siteName : "Demo Docs" ,
378377 repositoryNameSuffix : "-openapi" ,
379378 projectConfigurationFilename : ".demo-docs.yml" ,
@@ -405,7 +404,6 @@ test("It ignores files starting with a dot", async () => {
405404 }
406405 } )
407406 await sut . commentPullRequest ( {
408- hostURL : "https://localhost:3000" ,
409407 appInstallationId : 1234 ,
410408 pullRequestNumber : 42 ,
411409 repositoryOwner : "acme" ,
@@ -422,6 +420,7 @@ test("It ignores files in directories", async () => {
422420 let didAddComment = false
423421 let commentBody : string | undefined
424422 const sut = new PullRequestCommenter ( {
423+ domain : "https://example.com" ,
425424 siteName : "Demo Docs" ,
426425 repositoryNameSuffix : "-openapi" ,
427426 projectConfigurationFilename : ".demo-docs.yml" ,
@@ -453,7 +452,6 @@ test("It ignores files in directories", async () => {
453452 }
454453 } )
455454 await sut . commentPullRequest ( {
456- hostURL : "https://localhost:3000" ,
457455 appInstallationId : 1234 ,
458456 pullRequestNumber : 42 ,
459457 repositoryOwner : "acme" ,
@@ -469,6 +467,7 @@ test("It ignores files in directories", async () => {
469467test ( "It does not post comment if changes only include ignored filenames" , async ( ) => {
470468 let didAddComment = false
471469 const sut = new PullRequestCommenter ( {
470+ domain : "https://example.com" ,
472471 siteName : "Demo Docs" ,
473472 repositoryNameSuffix : "-openapi" ,
474473 projectConfigurationFilename : ".demo-docs.yml" ,
@@ -499,7 +498,6 @@ test("It does not post comment if changes only include ignored filenames", async
499498 }
500499 } )
501500 await sut . commentPullRequest ( {
502- hostURL : "https://localhost:3000" ,
503501 appInstallationId : 1234 ,
504502 pullRequestNumber : 42 ,
505503 repositoryOwner : "acme" ,
0 commit comments