pull/469/head
Rick Carlino 2017-09-27 09:05:32 -05:00
parent 687a4715ea
commit e05eb7f400
3 changed files with 24 additions and 1 deletions

View File

@ -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,

View File

@ -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);
});
});

View File

@ -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.`);
}
}