@@ -55,24 +55,26 @@ describe('Parser', function() {
5555 component . should . be . a . Function ( )
5656 } )
5757
58- it ( 'passes arguments to component ' , ( ) => {
58+ it ( 'passes state handler to root ' , ( ) => {
5959 const fake_component = sinon . stub ( ) . returns ( sinon . stub ( ) . returns ( sinon . spy ( ) ) )
6060 const fake_component_loader = sinon . stub ( ) . returns ( fake_component )
6161 const my_selection = null
62- const component = parse ( fake_component_loader ) ( { 'component' : 'foo ' , 'args' : { 'magic ' : 42 } } )
62+ const component = parse ( fake_component_loader ) ( { 'component' : 'root ' , 'args' : { 'title ' : '' } } )
6363 component ( my_selection )
64- fake_component . should . be . calledWith ( { 'magic' : 42 , 'state_handler' : sinon . match . any } )
64+ fake_component . should . be . calledWith ( {
65+ 'title' : '' ,
66+ 'state_handler' : fake_state_handler
67+ } )
6568 } )
6669
67- it ( 'passes state handler to root' , ( ) => {
70+ it ( 'only passes state handler to root' , ( ) => {
6871 const fake_component = sinon . stub ( ) . returns ( sinon . stub ( ) . returns ( sinon . spy ( ) ) )
6972 const fake_component_loader = sinon . stub ( ) . returns ( fake_component )
7073 const my_selection = null
71- const component = parse ( fake_component_loader ) ( { 'component' : 'root ' , 'args' : { 'title ' : '' } } )
74+ const component = parse ( fake_component_loader ) ( { 'component' : 'text ' , 'args' : { 'tagName ' : 'p ' } } )
7275 component ( my_selection )
7376 fake_component . should . be . calledWith ( {
74- 'title' : '' ,
75- 'state_handler' : fake_state_handler
77+ 'tagName' : 'p' ,
7678 } )
7779 } )
7880
0 commit comments