You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'https://github.com/orgs/github/repositories. Project URL should match the format https://github.com/<orgs-or-users>/<ownerName>/projects/<projectNumber>',
575
+
'Invalid project URL: https://github.com/orgs/github/repositories. Project URL should match the format <GitHub server domain name>/<orgs-or-users>/<ownerName>/projects/<projectNumber>',
576
576
)
577
577
expect(infoSpy).not.toHaveBeenCalled()
578
578
expect(gqlMock).not.toHaveBeenCalled()
579
579
})
580
580
581
-
test(`throws an error when url isn't under the github.com domain`,async()=>{
'https://notgithub.com/orgs/github/projects/1. Project URL should match the format https://github.com/<orgs-or-users>/<ownerName>/projects/<projectNumber>',
597
+
mockGraphQL(
598
+
{
599
+
test: /getProject/,
600
+
return: {
601
+
organization: {
602
+
projectV2: {
603
+
id: 'project-id',
604
+
},
605
+
},
606
+
},
607
+
},
608
+
{
609
+
test: /addProjectV2ItemById/,
610
+
return: {
611
+
addProjectV2ItemById: {
612
+
item: {
613
+
id: 'project-item-id',
614
+
},
615
+
},
616
+
},
617
+
},
606
618
)
607
-
expect(infoSpy).not.toHaveBeenCalled()
608
-
expect(gqlMock).not.toHaveBeenCalled()
619
+
620
+
awaitaddToProject()
621
+
622
+
expect(outputs.itemId).toEqual('project-item-id')
609
623
})
610
624
611
625
test('constructs the correct graphQL query given an organization owner',async()=>{
@@ -80,7 +77,7 @@ export async function addToProject(): Promise<void> {
80
77
81
78
if(!urlMatch){
82
79
thrownewError(
83
-
`Invalid project URL: ${projectUrl}. Project URL should match the format https://github.com/<orgs-or-users>/<ownerName>/projects/<projectNumber>`,
80
+
`Invalid project URL: ${projectUrl}. Project URL should match the format <GitHub server domain name>/<orgs-or-users>/<ownerName>/projects/<projectNumber>`,
0 commit comments