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:
William Chargin 2018-07-24 19:19:53 -07:00 committed by GitHub
parent 0489ff8844
commit c0da12af6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,7 @@
import React from "react";
import {shallow} from "enzyme";
import BrowserLocalStore from "../browserLocalStore";
import MemoryLocalStore from "../memoryLocalStore";
import {pagerank} from "../../core/attribution/pagerank";
import {App} from "./App";
@ -97,14 +97,7 @@ function example() {
describe("app/credExplorer/App", () => {
function makeLocalStore() {
// TODO(@wchargin): This should be an in-memory implementation of
// 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",
});
return new MemoryLocalStore();
}
it("renders with clean state", () => {
shallow(<App localStore={makeLocalStore()} />);