Skip to content

FLUID-6281: Adding test case to verify issue. #902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions tests/framework-tests/core/js/FluidIoCTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -4912,4 +4912,59 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
freeModel.destroy();
advisor.destroy();
});

/** FLUID-6281: Can't refer to a subcomponent by its grade name in an IoC reference for model listener on the parent. **/

fluid.defaults("fluid.tests.FLUID6281.child", {
gradeNames: ["fluid.component"],
members: {
myName: "",
desc: ""
},
invokers: {
setName: {
funcName: "fluid.set",
args: ["{that}", ["myName"], "{arguments}.0"]
},
setDesc: {
funcName: "fluid.set",
args: ["{that}", ["desc"], "{arguments}.0"]
}
}
});

fluid.defaults("fluid.tests.FLUID6281", {
gradeNames: ["fluid.modelComponent"],
components: {
childComp: {
type: "fluid.tests.FLUID6281.child"
}
},
model: {
name: "The Component",
description: "I'm a component"
},
modelListeners: {
"name": {
listener: "{fluid.tests.FLUID6281.child}.setName",
args: ["{change}.value"],
namespace: "passDownName"
},
"description": {
listener: "{that}.setDesc",
args: ["{change}.value"],
namespace: "passDownDesc"
}
},
invokers: {
setDesc: "{fluid.tests.FLUID6281.child}.setDesc"
}
});

jqUnit.test("FLUID-6281: Can't refer to a subcomponent by its grade name in an IoC reference for model listener on the parent", function () {
var that = fluid.tests.FLUID6281();
jqUnit.assertEquals("The myName member of the child should be set", that.model.name, that.childComp.myName);
jqUnit.assertEquals("The desc member of the child should be set", that.model.description, that.childComp.desc);
});

})(jQuery);