Files
extension/__mocks__/extensionizer.ts
T
Bartłomiej Rutkowski 29122d1f8f Export account (#166)
* setup tests

* export account WIP

* Fix linter errors.

* Frontend test for Export component.

* Test for account export by background handler.

* Add password to export.

* Add simple account export functionality.

* Add dedicated selectors.

* Improve export view layout

* make export textarea bigger

* Fix linter error.

* Update wrapper in test to make it pass.

* test refactoring

* add copying exported JSON to clipboard

* lint fix

* add UI tests

* fix dependencies

* refactoring

* copyright headers; minor refactorings

* make input field blink after entering wrong password

* download exported JSON

* simplify exported JSON download

* removed redundant tests

* disable export functionality for external accounts

* add export restrictions tests

* tests refactoring

* after successful export go back to main screen
2019-10-04 17:03:36 +02:00

32 lines
756 B
TypeScript

// Copyright 2019 @polkadot/extension-ui authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
/* eslint-disable @typescript-eslint/no-explicit-any */
import chrome from 'sinon-chrome';
class MessagingFake {
private listeners: any = [];
get onMessage (): any {
return {
addListener: (cb: any): any => this.listeners.push(cb)
};
}
get onDisconnect (): any {
return {
addListener: (): any => {}
};
}
postMessage (data: any): void {
this.listeners.forEach((cb: any) => cb.call(this, data));
}
}
const messagingFake = new MessagingFake();
chrome.runtime.connect.returns(messagingFake);
export default chrome;