File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -66,4 +66,35 @@ describe('router/history/base', () => {
66
66
expect ( url ) . toBe ( '/README' ) ;
67
67
} ) ;
68
68
} ) ;
69
+
70
+ // alias: uri
71
+ // ---------------------------------------------------------------------------
72
+ describe ( 'getFile' , ( ) => {
73
+ // Tests
74
+ // -------------------------------------------------------------------------
75
+ test ( 'path is url' , ( ) => {
76
+ const file = history . getFile ( 'https://some/raw/url/README.md' ) ;
77
+
78
+ expect ( file ) . toBe ( 'https://some/raw/url/README.md' ) ;
79
+ } ) ;
80
+ test ( 'path is url, but ext is .html' , ( ) => {
81
+ const file = history . getFile ( 'https://foo.com/index.html' ) ;
82
+
83
+ expect ( file ) . toBe ( 'https://foo.com/index.html' ) ;
84
+ } ) ;
85
+ test ( 'path is url, bug with parameters' , ( ) => {
86
+ const file = history . getFile (
87
+ 'https://some/raw/url/README.md?token=Mytoken'
88
+ ) ;
89
+
90
+ expect ( file ) . toBe ( 'https://some/raw/url/README.md?token=Mytoken' ) ;
91
+ } ) ;
92
+ test ( 'path is url, but ext is different' , ( ) => {
93
+ history = new MockHistory ( { ext : '.ext' } ) ;
94
+
95
+ const file = history . getFile ( 'https://some/raw/url/README.md' ) ;
96
+
97
+ expect ( file ) . toBe ( 'https://some/raw/url/README.md.ext' ) ;
98
+ } ) ;
99
+ } ) ;
69
100
} ) ;
You can’t perform that action at this time.
0 commit comments