Bridge registration session state as handle

This commit is contained in:
Alex Bakon
2025-03-26 09:15:20 -04:00
committed by GitHub
parent fec7342bf8
commit 394ade4a5f
7 changed files with 98 additions and 71 deletions

View File

@@ -20,6 +20,8 @@ import {
Environment,
Net,
newNativeHandle,
RegistrationService,
RegistrationSessionState,
SIGNAL_TLS_PROXY_SCHEME,
TokioAsyncContext,
UnauthenticatedChatConnection,
@@ -879,16 +881,18 @@ describe('cdsi lookup', () => {
describe('registration client', () => {
describe('registration session conversion', () => {
const expectedSession: Native.RegistrationSession = {
const expectedSession: RegistrationSessionState = {
allowedToRequestCode: true,
verified: true,
nextCallSecs: 123,
nextSmsSecs: 456,
nextVerificationAttemptSecs: 789,
requestedInformation: ['pushChallenge'],
requestedInformation: new Set(['pushChallenge']),
};
const convertedSession = Native.TESTING_RegistrationSessionInfoConvert();
const convertedSession = RegistrationService._convertNativeSessionState(
newNativeHandle(Native.TESTING_RegistrationSessionInfoConvert())
);
expect(convertedSession).to.deep.equal(expectedSession);
});
});