diff --git a/frontend/devices/pin_bindings/list_and_label_support.tsx b/frontend/devices/pin_bindings/list_and_label_support.tsx index f7faacbb5..34fc6e5ae 100644 --- a/frontend/devices/pin_bindings/list_and_label_support.tsx +++ b/frontend/devices/pin_bindings/list_and_label_support.tsx @@ -66,8 +66,10 @@ enum SystemPins { reset = 19, } -const sysLedBindings = Object.values(LEDPin); -const otherSysBindings = Object.values(SystemPins); +const toPinNum = (n: string) => parseInt(n); + +const sysLedBindings: number[] = Object.values(LEDPin).map(toPinNum); +const otherSysBindings: number[] = Object.values(SystemPins).map(toPinNum); /** All pin numbers used by FarmBot OS that cannot be used in pin bindings. */ export const sysBindings = sysLedBindings.concat(sysBtnBindings, otherSysBindings); diff --git a/frontend/farmware/weed_detector/__tests__/actions_tests.ts b/frontend/farmware/weed_detector/__tests__/actions_tests.ts index a63291b20..2b15829c4 100644 --- a/frontend/farmware/weed_detector/__tests__/actions_tests.ts +++ b/frontend/farmware/weed_detector/__tests__/actions_tests.ts @@ -66,6 +66,7 @@ describe("deletePoints()", () => { expect(axios.post).toHaveBeenCalledWith("http://localhost/api/points/search", { meta: { created_by: "plant-detection" } }); await expect(axios.delete).toHaveBeenCalledWith("http://localhost/api/points/1,2,3"); + await expect(error).not.toHaveBeenCalled(); expect(dispatch).toHaveBeenCalledWith({ payload: [1, 2, 3], type: Actions.DELETE_POINT_OK @@ -73,7 +74,6 @@ describe("deletePoints()", () => { expect(mockInc).toHaveBeenCalledTimes(2); expect(mockFinish).toHaveBeenCalledTimes(1); expect(success).toHaveBeenCalledWith("Deleted 3 weeds"); - expect(error).not.toHaveBeenCalled(); }); it("can't delete points", async () => { @@ -85,7 +85,7 @@ describe("deletePoints()", () => { { meta: { created_by: "plant-detection" } }); await expect(axios.delete).toHaveBeenCalledWith("http://localhost/api/points/1,2,3"); await expect(dispatch).not.toHaveBeenCalled(); - expect(mockInc).toHaveBeenCalledTimes(1); + await expect(mockInc).toHaveBeenCalledTimes(1); expect(mockFinish).toHaveBeenCalledTimes(1); expect(success).not.toHaveBeenCalledWith(); expect(error).toHaveBeenCalledWith(expect.stringContaining( @@ -103,6 +103,7 @@ describe("deletePoints()", () => { { meta: { created_by: "plant-detection" } }); await expect(axios.delete).toHaveBeenCalledWith( expect.stringContaining("http://localhost/api/points/1,")); + await expect(error).not.toHaveBeenCalled(); expect(dispatch).toHaveBeenCalledWith({ payload: expect.arrayContaining([1]), type: Actions.DELETE_POINT_OK @@ -110,6 +111,5 @@ describe("deletePoints()", () => { expect(mockInc).toHaveBeenCalledTimes(3); expect(mockFinish).toHaveBeenCalledTimes(1); expect(success).toHaveBeenCalledWith("Deleted 200 weeds"); - expect(error).not.toHaveBeenCalled(); }); }); diff --git a/frontend/sequences/step_tiles/pin_and_peripheral_support.tsx b/frontend/sequences/step_tiles/pin_and_peripheral_support.tsx index bc4aa9c99..e0808bfbe 100644 --- a/frontend/sequences/step_tiles/pin_and_peripheral_support.tsx +++ b/frontend/sequences/step_tiles/pin_and_peripheral_support.tsx @@ -169,7 +169,7 @@ export function namedPin2DropDown(ri: ResourceIndex, input: NamedPin | Nothing): export const dropDown2CeleryArg = (ri: ResourceIndex, item: DropDownItem): number | NamedPin => { if (isString(item.value)) { // str means "Named Pin". num means "Raw Pin" - if (Object.values(BoxLed).includes(item.value)) { + if (Object.values(BoxLed).map((x: string) => x).includes(item.value)) { return { kind: "named_pin", args: { pin_type: item.value as AllowedPinTypes, pin_id: -1 } diff --git a/package.json b/package.json index cbd4a8892..18b413dbf 100644 --- a/package.json +++ b/package.json @@ -24,16 +24,16 @@ "author": "farmbot.io", "license": "MIT", "dependencies": { - "@babel/core": "7.5.5", + "@babel/core": "7.6.0", "@blueprintjs/core": "3.18.0", "@blueprintjs/datetime": "3.9.2", "@blueprintjs/select": "3.10.0", "@types/enzyme": "3.10.3", "@types/jest": "24.0.18", - "@types/lodash": "4.14.137", + "@types/lodash": "4.14.138", "@types/markdown-it": "0.0.8", - "@types/moxios": "0.4.8", - "@types/node": "12.7.2", + "@types/moxios": "0.4.9", + "@types/node": "12.7.4", "@types/promise-timeout": "1.3.0", "@types/react": "16.9.2", "@types/react-color": "3.0.1", @@ -45,8 +45,8 @@ "coveralls": "3.0.6", "enzyme": "3.10.0", "enzyme-adapter-react-16": "1.14.0", - "farmbot": "8.1.6", - "i18next": "17.0.12", + "farmbot": "8.2.0-rc1", + "i18next": "17.0.14", "lodash": "4.17.15", "markdown-it": "9.1.0", "markdown-it-emoji": "1.4.0", @@ -63,17 +63,17 @@ "react-joyride": "2.1.1", "react-redux": "7.1.1", "react-test-renderer": "16.9.0", - "react-transition-group": "4.2.2", + "react-transition-group": "4.3.0", "redux": "4.0.4", "redux-immutable-state-invariant": "2.1.0", "redux-thunk": "2.3.0", - "sass": "1.22.10", + "sass": "1.23.0-module.beta.1", "sass-lint": "1.13.1", "takeme": "0.11.3", "ts-jest": "24.0.2", "ts-lint": "4.5.1", "tslint": "5.19.0", - "typescript": "3.5.3", + "typescript": "3.6.2", "which": "1.3.1" }, "devDependencies": {