Skip to content

Commit 1d4a1ff

Browse files
committed
Add more tests for TunnelState
1 parent 1411610 commit 1d4a1ff

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/TunnelState.test.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import TunnelState from '../src/TunnelState'
22

33
const TUNNEL_ID = 'GroompyTunnel'
4-
const ITEM_ID = 'GroomyItem'
4+
const ITEM_ID = 'GroompyItem'
5+
const ITEM_ID2 = 'GroompyItem2'
56
const props = { message: 'Aihop!' }
7+
const props2 = { message: 'Auhip!' }
68

79
describe('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
})

0 commit comments

Comments
 (0)