@@ -190,6 +190,15 @@ describe('Organization Billing', () => {
190190 expect ( result . error ) . toBeUndefined ( )
191191 } )
192192
193+ it ( 'should validate and normalize SSH URLs' , ( ) => {
194+ const result = validateAndNormalizeRepositoryUrl (
195+ 'git@github.com:user/repo.git' ,
196+ )
197+ expect ( result . isValid ) . toBe ( true )
198+ expect ( result . normalizedUrl ) . toBe ( 'https://github.com/user/repo' )
199+ expect ( result . error ) . toBeUndefined ( )
200+ } )
201+
193202 it ( 'should reject invalid domains' , ( ) => {
194203 const result = validateAndNormalizeRepositoryUrl (
195204 'https://example.com/user/repo' ,
@@ -204,6 +213,12 @@ describe('Organization Billing', () => {
204213 expect ( result . error ) . toBe ( 'Repository domain not allowed' )
205214 } )
206215
216+ it ( 'should reject URLs without owner and repo path segments' , ( ) => {
217+ const result = validateAndNormalizeRepositoryUrl ( 'https://github.com' )
218+ expect ( result . isValid ) . toBe ( false )
219+ expect ( result . error ) . toBe ( 'Repository path must include owner and repo' )
220+ } )
221+
207222 it ( 'should accept allowed domains' , ( ) => {
208223 const domains = [ 'github.com' , 'gitlab.com' , 'bitbucket.org' ]
209224
0 commit comments