From fd65e5e8a07420e2b9ce8d97add3e71c071ef84f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 30 Nov 2020 16:14:45 +0000 Subject: [PATCH] Fix unit tests --- .../tests/fetchBindableProperties.spec.js | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/builder/tests/fetchBindableProperties.spec.js b/packages/builder/tests/fetchBindableProperties.spec.js index 92b4b76a3b..7f4c895ff9 100644 --- a/packages/builder/tests/fetchBindableProperties.spec.js +++ b/packages/builder/tests/fetchBindableProperties.spec.js @@ -11,7 +11,7 @@ describe("fetch bindable properties", () => { ) expect(componentBinding).toBeDefined() expect(componentBinding.type).toBe("instance") - expect(componentBinding.runtimeBinding).toBe("search-input-id.value") + expect(componentBinding.runtimeBinding).toBe("search-input-id") }) it("should not return bindable components when not in their context", () => { @@ -37,20 +37,22 @@ describe("fetch bindable properties", () => { expect(contextBindings.length).toBe(4) const namebinding = contextBindings.find( - b => b.runtimeBinding === "data.name" + b => b.runtimeBinding === "list-id.name" ) expect(namebinding).toBeDefined() expect(namebinding.readableBinding).toBe("list-name.Test Table.name") const descriptionbinding = contextBindings.find( - b => b.runtimeBinding === "data.description" + b => b.runtimeBinding === "list-id.description" ) expect(descriptionbinding).toBeDefined() expect(descriptionbinding.readableBinding).toBe( "list-name.Test Table.description" ) - const idbinding = contextBindings.find(b => b.runtimeBinding === "data._id") + const idbinding = contextBindings.find( + b => b.runtimeBinding === "list-id._id" + ) expect(idbinding).toBeDefined() expect(idbinding.readableBinding).toBe("list-name.Test Table._id") }) @@ -65,13 +67,13 @@ describe("fetch bindable properties", () => { expect(contextBindings.length).toBe(8) const namebinding_parent = contextBindings.find( - b => b.runtimeBinding === "parent.data.name" + b => b.runtimeBinding === "list-id.name" ) expect(namebinding_parent).toBeDefined() expect(namebinding_parent.readableBinding).toBe("list-name.Test Table.name") const descriptionbinding_parent = contextBindings.find( - b => b.runtimeBinding === "parent.data.description" + b => b.runtimeBinding === "list-id.description" ) expect(descriptionbinding_parent).toBeDefined() expect(descriptionbinding_parent.readableBinding).toBe( @@ -79,7 +81,7 @@ describe("fetch bindable properties", () => { ) const namebinding_own = contextBindings.find( - b => b.runtimeBinding === "data.name" + b => b.runtimeBinding === "child-list-id.name" ) expect(namebinding_own).toBeDefined() expect(namebinding_own.readableBinding).toBe( @@ -87,7 +89,7 @@ describe("fetch bindable properties", () => { ) const descriptionbinding_own = contextBindings.find( - b => b.runtimeBinding === "data.description" + b => b.runtimeBinding === "child-list-id.description" ) expect(descriptionbinding_own).toBeDefined() expect(descriptionbinding_own.readableBinding).toBe( @@ -104,7 +106,7 @@ describe("fetch bindable properties", () => { r => r.instance._id === "list-item-input-id" && r.type === "instance" ) expect(componentBinding).toBeDefined() - expect(componentBinding.runtimeBinding).toBe("list-item-input-id.value") + expect(componentBinding.runtimeBinding).toBe("list-item-input-id") }) it("should not return components from child context", () => {