Skip to content

Commit 87fc5e7

Browse files
committed
test(expo): assert configureWithOptions in background native sync tests
#10199 added two native sync tests that assert on the legacy configure call. #9373 merged right after and made bootstrap call configureWithOptions by default, so both tests fail on main.
1 parent 070d71c commit 87fc5e7

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

‎packages/expo/src/provider/__tests__/ClerkProvider.nativeClientSync.test.tsx‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -679,14 +679,19 @@ describe('ClerkProvider native client sync', () => {
679679
await act(async () => {
680680
await new Promise(resolve => setTimeout(resolve, 300));
681681
});
682-
expect(mocks.configure).not.toHaveBeenCalled();
682+
expect(mocks.configureWithOptions).not.toHaveBeenCalled();
683683

684684
act(() => {
685685
setAppState('active');
686686
});
687687

688-
await waitFor(() => expect(mocks.configure).toHaveBeenCalledWith('pk_test_123', 'client-token'));
689-
expect(mocks.configure).toHaveBeenCalledTimes(1);
688+
await waitFor(() =>
689+
expect(mocks.configureWithOptions).toHaveBeenCalledWith('pk_test_123', {
690+
bearerToken: 'client-token',
691+
proxyUrl: null,
692+
}),
693+
);
694+
expect(mocks.configureWithOptions).toHaveBeenCalledTimes(1);
690695
expect(mocks.syncClientStateFromJs).not.toHaveBeenCalled();
691696
expect(mocks.tokenCache.clearToken).not.toHaveBeenCalled();
692697

@@ -718,7 +723,12 @@ describe('ClerkProvider native client sync', () => {
718723
/>,
719724
);
720725

721-
await waitFor(() => expect(mocks.configure).toHaveBeenCalledWith('pk_test_123', 'client-token'));
726+
await waitFor(() =>
727+
expect(mocks.configureWithOptions).toHaveBeenCalledWith('pk_test_123', {
728+
bearerToken: 'client-token',
729+
proxyUrl: null,
730+
}),
731+
);
722732

723733
setAppState('background');
724734
mocks.nativeClientEvent = {

0 commit comments

Comments
 (0)