mirror of
https://github.com/status-im/sourcecred.git
synced 2025-02-10 03:34:15 +00:00
Use MemoryLocalStore
for existing tests (#525)
Summary: This resolves a TODO. It’s not urgent, but it’s good practice. wchargin-branch: use-memory-local-store
This commit is contained in:
parent
0489ff8844
commit
c0da12af6e
@ -2,7 +2,7 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import {shallow} from "enzyme";
|
import {shallow} from "enzyme";
|
||||||
|
|
||||||
import BrowserLocalStore from "../browserLocalStore";
|
import MemoryLocalStore from "../memoryLocalStore";
|
||||||
import {pagerank} from "../../core/attribution/pagerank";
|
import {pagerank} from "../../core/attribution/pagerank";
|
||||||
import {App} from "./App";
|
import {App} from "./App";
|
||||||
|
|
||||||
@ -97,14 +97,7 @@ function example() {
|
|||||||
|
|
||||||
describe("app/credExplorer/App", () => {
|
describe("app/credExplorer/App", () => {
|
||||||
function makeLocalStore() {
|
function makeLocalStore() {
|
||||||
// TODO(@wchargin): This should be an in-memory implementation of
|
return new MemoryLocalStore();
|
||||||
// LocalStore, not the browser version. This only works because the
|
|
||||||
// store is not actually needed for the shallow render to complete
|
|
||||||
// successfully.
|
|
||||||
return new BrowserLocalStore({
|
|
||||||
version: "1",
|
|
||||||
keyPrefix: "cred-explorer",
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
it("renders with clean state", () => {
|
it("renders with clean state", () => {
|
||||||
shallow(<App localStore={makeLocalStore()} />);
|
shallow(<App localStore={makeLocalStore()} />);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user