@@ -35,12 +35,12 @@ describe("Routing", () => {
3535 const name = "test-vocabulary" ;
3636 const namespace = "http://onto.fel.cvut.cz/ontologies/termit/vocabulary/" ;
3737 const path = Routing . getTransitionPath ( Routes . vocabularies , {
38- query : new Map ( [ [ "namespace" , namespace ] ] ) ,
38+ query : new Map ( [ [ "namespace" , encodeURIComponent ( namespace ) ] ] ) ,
3939 } ) ;
4040 const expectedPath =
4141 Routes . vocabularies . path . replace ( ":name" , name ) +
4242 "?namespace=" +
43- namespace ;
43+ encodeURIComponent ( namespace ) ;
4444 expect ( path ) . toEqual ( expectedPath ) ;
4545 } ) ;
4646 } ) ;
@@ -58,14 +58,14 @@ describe("Routing", () => {
5858 const iri = namespace + label ;
5959
6060 it ( "transitions to vocabulary summary for a vocabulary" , ( ) => {
61- const vocabulary = new Vocabulary ( { iri, label } ) ;
61+ const vocabulary = new Vocabulary ( { iri, label : langString ( label ) } ) ;
6262 TermItStore . getState ( ) . user = Generator . generateUser ( ) ;
6363
6464 RoutingInstance . transitionToAsset ( vocabulary ) ;
6565 expect ( historyMock . push ) . toHaveBeenCalledWith (
6666 Routing . getTransitionPath ( Routes . vocabularySummary , {
6767 params : new Map ( [ [ "name" , label ] ] ) ,
68- query : new Map ( [ [ "namespace" , namespace ] ] ) ,
68+ query : new Map ( [ [ "namespace" , encodeURIComponent ( namespace ) ] ] ) ,
6969 } )
7070 ) ;
7171 } ) ;
@@ -87,7 +87,7 @@ describe("Routing", () => {
8787 [ "name" , label ] ,
8888 [ "timestamp" , timestamp ] ,
8989 ] ) ,
90- query : new Map ( [ [ "namespace" , namespace ] ] ) ,
90+ query : new Map ( [ [ "namespace" , encodeURIComponent ( namespace ) ] ] ) ,
9191 } )
9292 ) ;
9393 } ) ;
@@ -105,7 +105,7 @@ describe("Routing", () => {
105105 [ "name" , label ] ,
106106 [ "termName" , termName ] ,
107107 ] ) ,
108- query : new Map ( [ [ "namespace" , namespace ] ] ) ,
108+ query : new Map ( [ [ "namespace" , encodeURIComponent ( namespace ) ] ] ) ,
109109 } )
110110 ) ;
111111 } ) ;
@@ -129,7 +129,7 @@ describe("Routing", () => {
129129 [ "termName" , termName ] ,
130130 [ "timestamp" , timestamp ] ,
131131 ] ) ,
132- query : new Map ( [ [ "namespace" , namespace ] ] ) ,
132+ query : new Map ( [ [ "namespace" , encodeURIComponent ( namespace ) ] ] ) ,
133133 } )
134134 ) ;
135135 } ) ;
@@ -142,12 +142,12 @@ describe("Routing", () => {
142142
143143 it ( "transitions to public vocabulary summary for a vocabulary" , ( ) => {
144144 TermItStore . getState ( ) . user = EMPTY_USER ;
145- const vocabulary = new Vocabulary ( { iri, label } ) ;
145+ const vocabulary = new Vocabulary ( { iri, label : langString ( label ) } ) ;
146146 RoutingInstance . transitionToPublicAsset ( vocabulary ) ;
147147 expect ( historyMock . push ) . toHaveBeenCalledWith (
148148 Routing . getTransitionPath ( Routes . publicVocabularySummary , {
149149 params : new Map ( [ [ "name" , label ] ] ) ,
150- query : new Map ( [ [ "namespace" , namespace ] ] ) ,
150+ query : new Map ( [ [ "namespace" , encodeURIComponent ( namespace ) ] ] ) ,
151151 } )
152152 ) ;
153153 } ) ;
@@ -164,7 +164,7 @@ describe("Routing", () => {
164164 [ "name" , label ] ,
165165 [ "termName" , term . label [ Constants . DEFAULT_LANGUAGE ] ] ,
166166 ] ) ,
167- query : new Map ( [ [ "namespace" , namespace ] ] ) ,
167+ query : new Map ( [ [ "namespace" , encodeURIComponent ( namespace ) ] ] ) ,
168168 } )
169169 ) ;
170170 } ) ;
0 commit comments