1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Return state when calling EncryptionPublicKeyController.cancelEncryptionPublicKey (#18845)

* returns state

* adds unit test
This commit is contained in:
Bernardo Garces Chapero 2023-04-27 12:39:37 +02:00 committed by GitHub
parent e6455e92ae
commit 1253c768c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -352,6 +352,15 @@ describe('EncryptionPublicKeyController', () => {
'Cancel',
);
});
it('returns current state', async () => {
getStateMock.mockReturnValueOnce(stateMock);
expect(
await encryptionPublicKeyController.cancelEncryptionPublicKey(
messageIdMock,
),
).toEqual(stateMock);
});
});
describe('message manager events', () => {

View File

@ -275,7 +275,7 @@ export default class EncryptionPublicKeyController extends BaseControllerV2<
* @param msgId - The id of the message to cancel.
*/
cancelEncryptionPublicKey(msgId: string) {
this._cancelAbstractMessage(this._encryptionPublicKeyManager, msgId);
return this._cancelAbstractMessage(this._encryptionPublicKeyManager, msgId);
}
/**