1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02: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 Dan Miller
parent 1626f22704
commit ca0a4bec3b
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);
}
/**