File tree 1 file changed +16
-1
lines changed
1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 1
- import { relativeRoot } from "../../../src/node/http"
1
+ import { constructRedirectPath , relativeRoot } from "../../../src/node/http"
2
2
3
3
describe ( "http" , ( ) => {
4
4
it ( "should construct a relative path to the root" , ( ) => {
@@ -9,3 +9,18 @@ describe("http", () => {
9
9
expect ( relativeRoot ( "/foo/bar/" ) ) . toStrictEqual ( "./../.." )
10
10
} )
11
11
} )
12
+
13
+ describe ( "constructRedirectPath" , ( ) => {
14
+ it ( "should preserve slashes in queryString so they are human-readable" , ( ) => {
15
+ // TODO@jsjoeio - use this package
16
+ // https://www.npmjs.com/package/@jest -mock/express
17
+ const mockReq = { }
18
+ // TODO@jsjoeio - I don't know how the query params should look here
19
+ const mockQueryParams = { folder : "yes" }
20
+ // TODO@jsjoeio - I think we're redirecting to the same path so could be "" maybe?
21
+ const mockTo = "something"
22
+ const actual = constructRedirectPath ( mockReq , mockQueryParams , mockTo )
23
+ const expected = "TODO"
24
+ expect ( actual ) . toBe ( expected )
25
+ } )
26
+ } )
You can’t perform that action at this time.
0 commit comments