File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,19 @@ describe('URLs validation', function() {
160160 cy . get ( '#errorMessage' ) . should ( 'have.text' , '' ) ;
161161 } ) ;
162162
163+ it ( 'accepts git+https:// URLs' , function ( ) {
164+ cy . get ( '#codemetaText' ) . then ( ( elem ) =>
165+ elem . text ( JSON . stringify ( {
166+ "@context" : "https://doi.org/10.5063/schema/codemeta-2.0" ,
167+ "@type" : "SoftwareSourceCode" ,
168+ "codeRepository" : [ "git+http://example.org/" , "git+http://example.com/" ] ,
169+ } ) )
170+ ) ;
171+ cy . get ( '#validateCodemeta' ) . click ( ) ;
172+
173+ cy . get ( '#errorMessage' ) . should ( 'have.text' , '' ) ;
174+ } ) ;
175+
163176 it ( 'errors on invalid URL' , function ( ) {
164177 cy . get ( '#codemetaText' ) . then ( ( elem ) =>
165178 elem . text ( JSON . stringify ( {
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ function trimSpaces(s) {
2929function isUrl ( s ) {
3030 try {
3131 const url = new URL ( s ) ;
32- if ( url . origin == "null " ) {
32+ if ( url . hostname == "" ) {
3333 // forbids "foo: bar" as a URL, for example
3434 return false ;
3535 }
You can’t perform that action at this time.
0 commit comments