File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ class Sidebar extends React.Component<Props, State> {
135135 handleAnnotationSelect = ( annotationId : string | null ) : void => {
136136 const { history } = this . props ;
137137 const urlPrefix = this . getUrlPrefix ( history . location . pathname ) ;
138- const annotationUrl = annotationId ? `/${ urlPrefix } /annotations/${ annotationId } ` : '/' ;
138+ const annotationUrl = annotationId ? `/${ urlPrefix } /annotations/${ annotationId } ` : `/ ${ urlPrefix } ` ;
139139
140140 history . push ( annotationUrl ) ;
141141 } ;
Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ describe('elements/content-sidebar/Sidebar', () => {
148148 expect ( historyMock . push ) . toHaveBeenCalledWith ( '/activity/annotations/123' ) ;
149149 } ) ;
150150
151- test ( 'should handle setting url back to / if no id provided' , ( ) => {
151+ test ( 'should handle setting url back to url prefix if no id provided' , ( ) => {
152152 const historyMock = {
153153 push : jest . fn ( ) ,
154154 location : {
@@ -161,7 +161,7 @@ describe('elements/content-sidebar/Sidebar', () => {
161161
162162 instance . handleAnnotationSelect ( null ) ;
163163
164- expect ( historyMock . push ) . toHaveBeenCalledWith ( '/' ) ;
164+ expect ( historyMock . push ) . toHaveBeenCalledWith ( '/activity ' ) ;
165165 } ) ;
166166 } ) ;
167167
You can’t perform that action at this time.
0 commit comments