WIP
parent
687a4715ea
commit
e05eb7f400
|
@ -3,6 +3,18 @@ import { TaggedResource } from "../resources/tagged_resources";
|
|||
import * as _ from "lodash";
|
||||
|
||||
export let FAKE_RESOURCES: TaggedResource[] = [
|
||||
{
|
||||
"kind": "users",
|
||||
"body": {
|
||||
"id": 152,
|
||||
"name": "FarmBot 1",
|
||||
"email": "farmbot1@farmbot.io",
|
||||
"created_at": "2017-09-03T20:01:40.336Z",
|
||||
"updated_at": "2017-09-27T14:00:47.326Z",
|
||||
},
|
||||
"specialStatus": undefined,
|
||||
"uuid": "users.152.44"
|
||||
},
|
||||
{
|
||||
"kind": "device",
|
||||
"specialStatus": undefined,
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
import { mapStateToProps } from "../state_to_props";
|
||||
import { fakeState } from "../../__test_support__/fake_state";
|
||||
|
||||
describe("mapStateToProps()", () => {
|
||||
it("populates user", () => {
|
||||
const result = mapStateToProps(fakeState());
|
||||
expect(result.user).toBeTruthy();
|
||||
expect(result.user).toBeInstanceOf(Object);
|
||||
});
|
||||
});
|
|
@ -473,8 +473,9 @@ export function getUserAccountSettings(index: ResourceIndex): TaggedUser {
|
|||
if (user) {
|
||||
return user;
|
||||
} else {
|
||||
debugger;
|
||||
throw new Error(`PROBLEM: Expected getUserAccountSettings() to return
|
||||
exactly 1 device. We got some other number back, indicating a hazardous
|
||||
exactly 1 user. We got some other number back, indicating a hazardous
|
||||
condition.`);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue