mirror of
https://github.com/status-im/safe-react.git
synced 2025-01-11 02:25:40 +00:00
88bfca0a0d
* WA-280 Added redux logic for safe route * WA-280 Added tests including builders for safe's redux store classes * WA-280 Improving Flow coverage in actions and reducers * WA- 280 Mocking LocalStorage and Web3 in JEST * WA-280 Generating view of Safe route and its logic to store and retrieve info from localstorage * WA-280 Added run-with-testrpc for simulating a testnet in memory while executing tests
27 lines
355 B
JavaScript
27 lines
355 B
JavaScript
// @flow
|
|
class LocalStorageMock {
|
|
store: Object
|
|
|
|
constructor() {
|
|
this.store = {}
|
|
}
|
|
|
|
clear() {
|
|
this.store = {}
|
|
}
|
|
|
|
getItem(key) {
|
|
return this.store[key] || null
|
|
}
|
|
|
|
setItem(key, value) {
|
|
this.store[key] = value.toString()
|
|
}
|
|
|
|
removeItem(key) {
|
|
delete this.store[key]
|
|
}
|
|
}
|
|
|
|
global.localStorage = new LocalStorageMock()
|