-
-
Notifications
You must be signed in to change notification settings - Fork 607
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
Fix test that will break with matrix-sdk-crypto-wasm 13.0.0 #4635
Fix test that will break with matrix-sdk-crypto-wasm 13.0.0 #4635
Conversation
The test runs correctly when I run only the |
"Cannot pin identity of unknown user", | ||
); | ||
}); | ||
|
||
it("throws an error for our own user", async () => { | ||
const ownIdentity = new RustSdkCryptoJs.OwnUserIdentity(); |
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.
Isn't it more simple to just do
const ownIdentity = { } as unknown as Mocked<RustSdkCryptoJs.OwnUserIdentity>;
Instead of bringing all the key receiver/responder framework?
I added similar tests in this PR https://github.com/matrix-org/matrix-js-sdk/pull/4646/files
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.
The problem is that pinCurrentUserIdentity
uses instanceof
to check whether it's an OwnUserIdentity
, so it needs a real OwnUserIdentity
object.
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.
Looks good, thanks!
Remove use of a constructor that never should have been there.
Fixes #4634
Checklist
public
/exported
symbols have accurate TSDoc documentation.