File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,32 @@ import * as util from 'ionic-angular/util';
3
3
export function run ( ) {
4
4
describe ( 'extend' , function ( ) {
5
5
6
+ describe ( 'getQuerystring' , function ( ) {
7
+ it ( 'should have no entries for empty url' , ( ) => {
8
+ expect ( util . getQuerystring ( '' ) ) . toEqual ( { } ) ;
9
+ } ) ;
10
+
11
+ it ( 'should have no entries for url with no "?" character' , ( ) => {
12
+ expect ( util . getQuerystring ( 'http://localhost:1234/#key1=1&key2=2' ) ) . toEqual ( { } ) ;
13
+ } ) ;
14
+
15
+ it ( 'should contain key/value entries for all the parameters after "?" character' , ( ) => {
16
+ expect ( util . getQuerystring ( 'http://localhost:1234/#key0=0&key0x=0x?key1=1&key2=2' ) ) . toEqual ( {
17
+ key1 : '1' ,
18
+ key2 : '2'
19
+ } ) ;
20
+ } ) ;
21
+
22
+ it ( 'should ignore empty ?& and &&' , ( ) => {
23
+ expect ( util . getQuerystring ( 'http://localhost:1234/#?&&' ) ) . toEqual ( { } ) ;
24
+
25
+ expect ( util . getQuerystring ( 'http://localhost:1234/#?&&key1=1&key2=2&&' ) ) . toEqual ( {
26
+ key1 : '1' ,
27
+ key2 : '2'
28
+ } ) ;
29
+ } ) ;
30
+ } ) ;
31
+
6
32
describe ( 'isTrueProperty' , function ( ) {
7
33
8
34
it ( 'should be true from boolean true' , ( ) => {
You can’t perform that action at this time.
0 commit comments