-
-
Notifications
You must be signed in to change notification settings - Fork 611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test typescriptification - last few unit test files #2675
Conversation
…o/verification/sas.spec.ts
…/unit/crypto/verification/secret_request.spec.ts
…> spec/unit/crypto/verification/verification_request.spec.ts
…ync-browserify.spec.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM aside from minor code style nitpicks
@@ -115,7 +133,7 @@ function makeRemoteEcho(event) { | |||
|
|||
async function distributeEvent(ownRequest, theirRequest, event) { | |||
await ownRequest.channel.handleEvent( | |||
makeRemoteEcho(event), ownRequest, true); | |||
makeRemoteEcho(event), ownRequest, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makeRemoteEcho(event), ownRequest, true); | |
makeRemoteEcho(event), ownRequest, true, | |
); |
new InRoomChannel(alice, "!room", bob.getUserId()), | ||
new Map([[MOCK_METHOD, MockVerifier]]), alice); | ||
new InRoomChannel(alice, "!room", bob.getUserId()!), | ||
verificationMethods, alice); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verificationMethods, alice); | |
verificationMethods, alice, | |
); |
const bobRequest = new VerificationRequest( | ||
new InRoomChannel(bob, "!room"), | ||
new Map([[MOCK_METHOD, MockVerifier]]), bob); | ||
verificationMethods, bob); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verificationMethods, bob); | |
verificationMethods, bob, | |
); |
new InRoomChannel(alice, "!room", bob.getUserId()), | ||
new Map([["c", function() {}], ["a", function() {}]]), alice); | ||
new InRoomChannel(alice, "!room", bob.getUserId()!), | ||
aliceVerificationMethods, alice); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aliceVerificationMethods, alice); | |
aliceVerificationMethods, alice, | |
); |
const bobRequest = new VerificationRequest( | ||
new InRoomChannel(bob, "!room"), | ||
new Map([["c", function() {}], ["b", function() {}]]), bob); | ||
bobVerificationMethods, bob); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bobVerificationMethods, bob); | |
bobVerificationMethods, bob, | |
); |
new ToDeviceChannel(bob1, bob1.getUserId()!, ["device1", "device2"], | ||
ToDeviceChannel.makeTransactionId(), "device2"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new ToDeviceChannel(bob1, bob1.getUserId()!, ["device1", "device2"], | |
ToDeviceChannel.makeTransactionId(), "device2"), | |
new ToDeviceChannel( | |
bob1, bob1.getUserId()!, ["device1", "device2"], | |
ToDeviceChannel.makeTransactionId(), "device2", | |
), |
ToDeviceChannel.makeTransactionId(), "device2"), | ||
new Map([[MOCK_METHOD, MockVerifier]]), bob1); | ||
verificationMethods, bob1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verificationMethods, bob1); | |
verificationMethods, bob1, | |
); |
new ToDeviceChannel(bob2, bob2.getUserId(), ["device1"]), | ||
new Map([[MOCK_METHOD, MockVerifier]]), bob2); | ||
new ToDeviceChannel(bob2, bob2.getUserId()!, ["device1"]), | ||
verificationMethods, bob2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verificationMethods, bob2); | |
verificationMethods, bob2, | |
); |
@@ -253,11 +282,10 @@ describe("verification request unit tests", function() { | |||
const alice = makeMockClient("@alice:matrix.tld", "device1"); | |||
const bob = makeMockClient("@bob:matrix.tld", "device1"); | |||
const aliceRequest = new VerificationRequest( | |||
new InRoomChannel(alice, "!room", bob.getUserId()), new Map(), alice); | |||
new InRoomChannel(alice, "!room", bob.getUserId()!), new Map(), alice); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new InRoomChannel(alice, "!room", bob.getUserId()!), new Map(), alice); | |
new InRoomChannel(alice, "!room", bob.getUserId()!), new Map(), alice, | |
); |
@@ -269,7 +297,7 @@ describe("verification request unit tests", function() { | |||
const alice = makeMockClient("@alice:matrix.tld", "device1"); | |||
const bob = makeMockClient("@bob:matrix.tld", "device1"); | |||
const aliceRequest = new VerificationRequest( | |||
new InRoomChannel(alice, "!room", bob.getUserId()), new Map(), alice); | |||
new InRoomChannel(alice, "!room", bob.getUserId()!), new Map(), alice); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new InRoomChannel(alice, "!room", bob.getUserId()!), new Map(), alice); | |
new InRoomChannel(alice, "!room", bob.getUserId()!), new Map(), alice, | |
); |
* Update sonarcloud.yml (#2671) * Update sonarcloud.yml * test typescriptification - spec/unit/crypto/verification (#2673) * renamed: spec/unit/crypto/verification/request.spec.js -> spec/unit/crypto/verification/request.spec.ts * renamed: spec/unit/crypto/verification/qr_code.spec.js -> spec/unit/crypto/verification/qr_code.spec.ts * renamed: spec/unit/crypto/verification/InRoomChannel.spec.js -> spec/unit/crypto/verification/InRoomChannel.spec.ts * fix ts issues in InRoomChannel.spec * renamed: spec/unit/crypto/verification/util.js -> spec/unit/crypto/verification/util.ts * fix ts issues in util.t * fix strict errors in util.ts * js lint * test typescriptification - last few unit test files (#2675) * renamed: spec/unit/crypto/verification/sas.spec.js -> spec/unit/crypto/verification/sas.spec.ts * ts issues in sas.spec * renamed: spec/unit/crypto/verification/secret_request.spec.js -> spec/unit/crypto/verification/secret_request.spec.ts * ts issues in secret_request.spec * renamed: spec/unit/crypto/verification/verification_request.spec.js -> spec/unit/crypto/verification/verification_request.spec.ts * ts fix verification_req.spec * renamed: spec/browserify/sync-browserify.spec.js -> spec/browserify/sync-browserify.spec.ts * fix strict * formatting * Update babel monorepo to v7.19.1 (#2681) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update typescript-eslint monorepo to v5.38.0 (#2685) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Read receipts for threads (#2635) * Update all (#2684) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update jest monorepo to v29.0.3 (#2682) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Fix backpagination at end logic being spec non-conforming (#2680) * Support to remotely toggle push notifications (#2686) * Add unstable device_id field for MSC3881 (#2688) Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> Co-authored-by: Kerry <kerrya@element.io> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Germain <germains@element.io>
#2353
Checklist
This change is marked as an internal change (Task), so will not be included in the changelog.