Skip to content

Commit 32bc723

Browse files
committed
Corrected async test
1 parent a080463 commit 32bc723

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/BranchSubscriber.test.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,15 @@ test('will return a cached event when appropriate', done => {
8585
expect(subscriber.options.onOpenStart.mock.calls.length).toBe(1)
8686
expect(subscriber.options.onOpenStart.mock.calls[0][0]).toEqual({uri: null})
8787

88-
// full result passed to onOpenComplete
88+
// full result passed to onOpenComplete with +rn_cached_initial_event: true
8989
expect(subscriber.options.onOpenComplete.mock.calls.length).toBe(1)
90-
expect(subscriber.options.onOpenComplete.mock.calls[0][0]).toEqual(mockResult)
90+
const actualResult = subscriber.options.onOpenComplete.mock.calls[0][0]
91+
92+
let expectedParams = mockResult.params
93+
expectedParams['+rn_cached_initial_event'] = true
94+
expect(actualResult.params).toEqual(expectedParams)
95+
expect(actualResult.error).toEqual(mockResult.error)
96+
expect(actualResult.uri).toEqual(mockResult.uri)
9197

9298
// state cleared
9399
expect(subscriber._checkCachedEvents).toBe(false)

0 commit comments

Comments
 (0)