Skip to content

Commit 991ec2e

Browse files
committed
Updating test to confirm change is sent
1 parent 70c9a1a commit 991ec2e

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

test/simperium/channel_test.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,18 +164,20 @@ describe( 'Channel', function() {
164164
} );
165165

166166
it( 'should resend sent but unacknowledged changes on reconnect', () => new Promise( resolve => {
167-
channel.localQueue.sent['fake-ccid'] = { fake: 'change' }
167+
channel.localQueue.sent['fake-ccid'] = { fake: 'change', ccid: 'fake-ccid' }
168168

169169
channel.on( 'send', cycle(
170-
() => channel.handleMessage( 'i:{"index":[],"current":"cv"}'),
171-
m => {
170+
m => setImmediate( () => {
171+
equal( m, 'i:1:::10' )
172+
channel.handleMessage( 'i:{"index":[],"current":"cv"}' )
173+
} ),
174+
m => setImmediate( () => {
175+
equal( m, 'c:{"fake":"change","ccid":"fake-ccid"}')
172176
resolve()
173-
}
177+
} )
174178
) )
175179

176180
channel.handleMessage( 'auth:user@example.com' )
177-
178-
channel.emit( 'ready' )
179181
} ) )
180182

181183
it( 'should send remove operation', function( done ) {

0 commit comments

Comments
 (0)