File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 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', () => {
6666 expect ( url ) . toBe ( '/README' ) ;
6767 } ) ;
6868 } ) ;
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+ } ) ;
69100} ) ;
You can’t perform that action at this time.
0 commit comments