File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 11import TunnelState from '../src/TunnelState'
22
33const TUNNEL_ID = 'GroompyTunnel'
4- const ITEM_ID = 'GroomyItem'
4+ const ITEM_ID = 'GroompyItem'
5+ const ITEM_ID2 = 'GroompyItem2'
56const props = { message : 'Aihop!' }
7+ const props2 = { message : 'Auhip!' }
68
79describe ( 'TunnelState' , ( ) => {
810 it ( 'calls listeners when setting props and there are listeners' , ( ) => {
@@ -49,4 +51,11 @@ describe('TunnelState', () => {
4951 state . setTunnelProps ( TUNNEL_ID , ITEM_ID , props )
5052 expect ( state . getTunnelProps ( TUNNEL_ID ) ) . toEqual ( props )
5153 } )
54+
55+ it ( 'allows to retrieve an array of props when there are multiple items' , ( ) => {
56+ const state = new TunnelState ( )
57+ state . setTunnelProps ( TUNNEL_ID , ITEM_ID , props )
58+ state . setTunnelProps ( TUNNEL_ID , ITEM_ID2 , props2 )
59+ expect ( state . getTunnelProps ( TUNNEL_ID ) ) . toEqual ( [ props , props2 ] )
60+ } )
5261} )
You can’t perform that action at this time.
0 commit comments