|
|
|
@ -9,7 +9,7 @@ describe("fetch bindable properties", () => { |
|
|
|
const componentBinding = result.find(r => r.instance._id === "search-input-id" && r.type === "instance") |
|
|
|
expect(componentBinding).toBeDefined() |
|
|
|
expect(componentBinding.type).toBe("instance") |
|
|
|
expect(componentBinding.runtimeBinding).toBe("state.search-input-id.value") |
|
|
|
expect(componentBinding.runtimeBinding).toBe("search-input-id.value") |
|
|
|
}) |
|
|
|
|
|
|
|
it("should not return bindable components when not in their context", () => { |
|
|
|
@ -29,11 +29,11 @@ describe("fetch bindable properties", () => { |
|
|
|
const contextBindings = result.filter(r => r.instance._id === "list-id" && r.type==="context") |
|
|
|
expect(contextBindings.length).toBe(2) |
|
|
|
|
|
|
|
const namebinding = contextBindings.find(b => b.runtimeBinding === "context.data.name") |
|
|
|
const namebinding = contextBindings.find(b => b.runtimeBinding === "data.name") |
|
|
|
expect(namebinding).toBeDefined() |
|
|
|
expect(namebinding.readableBinding).toBe("list-name.Test Model.name") |
|
|
|
|
|
|
|
const descriptionbinding = contextBindings.find(b => b.runtimeBinding === "context.data.description") |
|
|
|
const descriptionbinding = contextBindings.find(b => b.runtimeBinding === "data.description") |
|
|
|
expect(descriptionbinding).toBeDefined() |
|
|
|
expect(descriptionbinding.readableBinding).toBe("list-name.Test Model.description") |
|
|
|
}) |
|
|
|
@ -46,19 +46,19 @@ describe("fetch bindable properties", () => { |
|
|
|
const contextBindings = result.filter(r => r.type==="context") |
|
|
|
expect(contextBindings.length).toBe(4) |
|
|
|
|
|
|
|
const namebinding_parent = contextBindings.find(b => b.runtimeBinding === "context._parent.data.name") |
|
|
|
const namebinding_parent = contextBindings.find(b => b.runtimeBinding === "parent.data.name") |
|
|
|
expect(namebinding_parent).toBeDefined() |
|
|
|
expect(namebinding_parent.readableBinding).toBe("list-name.Test Model.name") |
|
|
|
|
|
|
|
const descriptionbinding_parent = contextBindings.find(b => b.runtimeBinding === "context._parent.data.description") |
|
|
|
const descriptionbinding_parent = contextBindings.find(b => b.runtimeBinding === "parent.data.description") |
|
|
|
expect(descriptionbinding_parent).toBeDefined() |
|
|
|
expect(descriptionbinding_parent.readableBinding).toBe("list-name.Test Model.description") |
|
|
|
|
|
|
|
const namebinding_own = contextBindings.find(b => b.runtimeBinding === "context.data.name") |
|
|
|
const namebinding_own = contextBindings.find(b => b.runtimeBinding === "data.name") |
|
|
|
expect(namebinding_own).toBeDefined() |
|
|
|
expect(namebinding_own.readableBinding).toBe("child-list-name.Test Model.name") |
|
|
|
|
|
|
|
const descriptionbinding_own = contextBindings.find(b => b.runtimeBinding === "context.data.description") |
|
|
|
const descriptionbinding_own = contextBindings.find(b => b.runtimeBinding === "data.description") |
|
|
|
expect(descriptionbinding_own).toBeDefined() |
|
|
|
expect(descriptionbinding_own.readableBinding).toBe("child-list-name.Test Model.description") |
|
|
|
}) |
|
|
|
@ -70,7 +70,7 @@ describe("fetch bindable properties", () => { |
|
|
|
}) |
|
|
|
const componentBinding = result.find(r => r.instance._id === "list-item-input-id" && r.type === "instance") |
|
|
|
expect(componentBinding).toBeDefined() |
|
|
|
expect(componentBinding.runtimeBinding).toBe("context.list-item-input-id.value") |
|
|
|
expect(componentBinding.runtimeBinding).toBe("list-item-input-id.value") |
|
|
|
}) |
|
|
|
|
|
|
|
it("should not return components from child context", () => { |
|
|
|
|