File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,23 @@ describe('Editor', function() {
3131 await this . page . waitFor ( 3000 ) ;
3232 expect ( await this . page . $eval ( '#debugger-io' , isVisible ) ) . to . be . true ;
3333 } ) ;
34+
35+ const token = 'eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.' ;
36+ [ 'token' , 'value' , 'id_token' , 'access_token' ] . forEach ( ( key ) => {
37+ [
38+ `/?${ key } =${ token } ` ,
39+ `/#${ key } =${ token } ` ,
40+ `/?foo=bar&${ key } =${ token } ` ,
41+ `/#foo=bar&${ key } =${ token } ` ,
42+ ] . forEach ( ( structure , i ) => {
43+ it ( `Should parse ${ key } from window.location.href [${ i } ]` , async function ( ) {
44+ await this . page . goto ( `http://localhost:8000${ structure } ${ key } ${ i } ` ) ;
45+ expect ( await this . page . evaluate ( ( ) => {
46+ return window . test . tokenEditor . getValue ( ) ;
47+ } ) ) . to . equal ( `${ token } ${ key } ${ i } ` ) ;
48+ } ) ;
49+ } )
50+ } ) ;
3451
3552 it ( 'HS256 should be selected by default' , async function ( ) {
3653 const selected = await this . page . $eval ( '#algorithm-select' , select => {
You can’t perform that action at this time.
0 commit comments