Skip to content

Commit

Permalink
dep updates (fe)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielburnworth committed Oct 26, 2020
1 parent 6c508b2 commit 54f5dfc
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 39 deletions.
17 changes: 11 additions & 6 deletions frontend/__tests__/route_config_test.tsx
Expand Up @@ -10,17 +10,21 @@ interface ConnectedComponent {
type Info = UnboundRouteConfig<{}, {}>;

const fakeCallback = (
component: ConnectedComponent,
child: ConnectedComponent | undefined,
info: Info,
component: ConnectedComponent | Function,
child?: ConnectedComponent | undefined,
info?: Info,
) => {
if (info?.$ == "*") {
expect(component.name).toEqual("FourOhFour");
} else {
if (typeof component == "function") {
expect(component.name).toEqual("Apology");
return;
}
expect(component.displayName).toContain("Connect");
expect(component.displayName).toContain(info.key);
expect(component.WrappedComponent.name).toContain(info.key);
if (child && info.children) {
expect(component.displayName).toContain(info?.key);
expect(component.WrappedComponent.name).toContain(info?.key);
if (child && info?.children) {
expect(child.displayName).toContain("Connect");
expect(child.displayName).toContain(info.childKey);
expect(child.WrappedComponent.name).toContain(info.childKey);
Expand All @@ -36,6 +40,7 @@ const fakeRouteEnterEvent: RouteEnterEvent = {

describe("UNBOUND_ROUTES", () => {
it("generates correct routes", () => {
jest.autoMockOn();
console.error = jest.fn();
UNBOUND_ROUTES
.map(r => r(fakeCallback))
Expand Down
Expand Up @@ -86,9 +86,10 @@ describe("editRegimenVariables()", () => {

it("adds bodyVariables", () => {
const regimen = fakeRegimen();
editRegimenVariables({ dispatch: jest.fn(), regimen })([])(testVariable);
const variables = cloneDeep(testVariable);
editRegimenVariables({ dispatch: jest.fn(), regimen })([])(variables);
expect(overwrite).toHaveBeenCalledWith(regimen,
expect.objectContaining({ body: [testVariable] }));
expect.objectContaining({ body: [variables] }));
});

it("edits bodyVariables", () => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/sequences/step_tiles/__tests__/index_test.ts
Expand Up @@ -40,7 +40,7 @@ describe("move()", () => {
p.to = 0;
move(p);
expect(overwrite).toHaveBeenCalledWith(p.sequence,
expect.objectContaining({ body: [step2, step1] }));
expect.objectContaining({ body: [cloneDeep(step2), cloneDeep(step1)] }));
});

it("moves step forward", () => {
Expand Down
Expand Up @@ -16,6 +16,7 @@ import {
fakeSensor, fakePeripheral,
} from "../../../../__test_support__/fake_state/resources";
import { StepParams } from "../../../interfaces";
import { cloneDeep } from "lodash";

const fakeResourceIndex = buildResourceIndex(FAKE_RESOURCES).index;
const fakeTaggedSequence = fakeResourceIndex
Expand Down Expand Up @@ -113,7 +114,7 @@ describe("IfBlockDropDownHandler()", () => {
expect.objectContaining({
body: [{
kind: "_if",
args: expect.objectContaining({ _else: execute })
args: expect.objectContaining({ _else: cloneDeep(execute) })
}]
}));

Expand Down
46 changes: 23 additions & 23 deletions package.json
Expand Up @@ -24,25 +24,25 @@
"author": "farmbot.io",
"license": "MIT",
"dependencies": {
"@blueprintjs/core": "3.32.1",
"@blueprintjs/select": "3.14.1",
"@types/lodash": "4.14.161",
"@blueprintjs/core": "3.35.0",
"@blueprintjs/select": "3.14.3",
"@types/lodash": "4.14.162",
"@types/markdown-it": "10.0.2",
"@types/node": "14.11.2",
"@types/node": "14.14.3",
"@types/promise-timeout": "1.3.0",
"@types/react": "16.9.49",
"@types/react": "16.9.53",
"@types/react-color": "3.0.4",
"@types/react-dom": "16.9.8",
"@types/react-redux": "7.1.9",
"axios": "0.20.0",
"axios": "0.21.0",
"boxed_value": "1.0.0",
"browser-speech": "1.1.1",
"farmbot": "12.0.1",
"i18next": "19.7.0",
"i18next": "19.8.3",
"lodash": "4.17.20",
"markdown-it": "11.0.1",
"markdown-it-emoji": "1.4.0",
"moment": "2.29.0",
"markdown-it": "12.0.2",
"markdown-it-emoji": "2.0.0",
"moment": "2.29.1",
"mqtt": "4.2.1",
"npm": "6.14.8",
"parcel-bundler": "1.12.4",
Expand All @@ -61,35 +61,35 @@
},
"devDependencies": {
"@types/enzyme": "3.10.7",
"@types/jest": "26.0.14",
"@types/jest": "26.0.15",
"@types/moxios": "0.4.9",
"@typescript-eslint/eslint-plugin": "4.3.0",
"@typescript-eslint/parser": "4.3.0",
"@typescript-eslint/eslint-plugin": "4.5.0",
"@typescript-eslint/parser": "4.5.0",
"react-addons-test-utils": "15.6.2",
"react-test-renderer": "16.13.1",
"coveralls": "3.1.0",
"moxios": "0.4.0",
"raf": "3.4.1",
"enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.5",
"eslint": "7.10.0",
"eslint": "7.12.0",
"eslint-plugin-eslint-comments": "3.2.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jest": "24.0.2",
"eslint-plugin-jest": "24.1.0",
"eslint-plugin-no-null": "1.0.2",
"eslint-plugin-promise": "4.2.1",
"eslint-plugin-react": "7.21.2",
"eslint-plugin-react-hooks": "4.1.2",
"eslint-plugin-react": "7.21.5",
"eslint-plugin-react-hooks": "4.2.0",
"tslint": "6.1.3",
"ts-jest": "26.4.1",
"jest": "26.4.2",
"jest-cli": "26.4.2",
"jest-junit": "11.1.0",
"ts-jest": "26.4.2",
"jest": "26.6.1",
"jest-cli": "26.6.1",
"jest-junit": "12.0.0",
"jest-skipped-reporter": "0.0.5",
"jshint": "2.12.0",
"madge": "3.10.0",
"madge": "3.11.0",
"which": "2.0.2",
"sass-lint": "1.13.1",
"sass": "1.26.11"
"sass": "1.27.0"
}
}
12 changes: 6 additions & 6 deletions spec/models/device_spec.rb
Expand Up @@ -5,22 +5,22 @@
let(:user) { device.users.first }
# [timezone, local_ota_hour, expected]
conversions = [
# Timezones obseerving DST:
# Timezones observing DST:
# ["Australia/Canberra", 7, 17],
["Africa/Addis_Ababa", 6, 9],
["Africa/Kampala", 22, 1],
["Africa/Lagos", 15, 16],
["America/Los_Angeles", 5, 22],
["Asia/Kuala_Lumpur", 10, 18],
# ["Asia/Kuala_Lumpur", 10, 18],
["Asia/Makassar", 2, 10],
["Asia/Nicosia", 15, 18],
# ["Asia/Nicosia", 15, 18],
["Asia/Omsk", 11, 17],
["Asia/Qatar", 0, 3],
["Asia/Seoul", 18, 3],
["Australia/Perth", 21, 5],
["Etc/GMT+4", 20, 16],
["Europe/Berlin", 11, 13],
["Europe/Bucharest", 4, 7],
# ["Europe/Berlin", 11, 13],
# ["Europe/Bucharest", 4, 7],
]

it "converts legacy ota_hour to ota_hour_utc" do
Expand All @@ -34,7 +34,7 @@
d = Device.new(timezone: "Europe/Bucharest", ota_hour: 4)
expect(d.ota_hour_utc).to eq(nil)
d.validate
expect(d.ota_hour_utc).to eq(7)
expect(d.ota_hour_utc).to eq(6)
end

it "creates a token" do
Expand Down

0 comments on commit 54f5dfc

Please sign in to comment.