Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
mstijak committed May 14, 2024
1 parent 647fd89 commit 7e53574
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/cx/src/data/Binding.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Binding } from "./Binding";
import assert from "assert";
import { createAccessorModelProxy } from "./createAccessorModelProxy";

describe("Binding", function () {
describe("#get()", function () {
Expand All @@ -12,6 +13,13 @@ describe("Binding", function () {
it("allows non-standard property identifiers", function () {
var state = { person: { "@schema": "Person" } };
var b = Binding.get("person.@schema");
assert.equal(b.path, "person.@schema");
assert.equal(b.value(state), "Person");
});

it("properly resolves accessor models", function () {
var state = { person: { schema: "Person" } };
var b = Binding.get(createAccessorModelProxy("person.schema"));
assert.equal(b.value(state), "Person");
});
});
Expand Down

0 comments on commit 7e53574

Please sign in to comment.