Skip to content

Commit

Permalink
test(binding-modbus): fix validateAndFillForm assertions for URI para…
Browse files Browse the repository at this point in the history
…meters
  • Loading branch information
relu91 committed Jul 28, 2023
1 parent 6764035 commit 068550b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions packages/binding-modbus/test/modbus-client-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ describe("Modbus client test", () => {
};

// eslint-disable-next-line dot-notation
client["validateAndFillDefaultForm"](form);
form["modbus:unitID"].should.be.equal(2, "unitID value not set");
form["modbus:address"].should.be.equal(2, "address value not set");
form["modbus:quantity"].should.be.equal(5, "quantity value not set");
const result = client["validateAndFillDefaultForm"](form);
result["modbus:unitID"].should.be.equal(2, "unitID value not set");
result["modbus:address"].should.be.equal(2, "address value not set");
result["modbus:quantity"].should.be.equal(5, "quantity value not set");
});

it("should accept just URL parameters without quantity", () => {
Expand All @@ -141,9 +141,9 @@ describe("Modbus client test", () => {
};

// eslint-disable-next-line dot-notation
client["validateAndFillDefaultForm"](form);
form["modbus:unitID"].should.be.equal(2, "unitID value not set");
form["modbus:address"].should.be.equal(2, "address value not set");
const result = client["validateAndFillDefaultForm"](form);
result["modbus:unitID"].should.be.equal(2, "unitID value not set");
result["modbus:address"].should.be.equal(2, "address value not set");
});

it("should override correctly form values with URL", () => {
Expand All @@ -156,10 +156,10 @@ describe("Modbus client test", () => {
};

// eslint-disable-next-line dot-notation
client["overrideFormFromURLPath"](form);
form["modbus:unitID"].should.be.equal(2, "unitID value not overridden");
form["modbus:address"].should.be.equal(2, "address value not overridden");
form["modbus:quantity"].should.be.equal(5, "quantity value not overridden");
const result = client["validateAndFillDefaultForm"](form);
result["modbus:unitID"].should.be.equal(2, "unitID value not overridden");
result["modbus:address"].should.be.equal(2, "address value not overridden");
result["modbus:quantity"].should.be.equal(5, "quantity value not overridden");
});

describe("misc", () => {
Expand Down

0 comments on commit 068550b

Please sign in to comment.