FLUID-5496: IoC testing framework syntax for "event" listener fixtures should support the standard IoC resolution applied to "arguments"

Metadata

Source
FLUID-5496
Type
Improvement
Priority
Major
Status
Closed
Resolution
Fixed
Assignee
Antranig Basman
Reporter
Antranig Basman
Created
2014-08-19T11:55:45.550-0400
Updated
2015-06-26T10:11:56.500-0400
Versions
  1. 1.5
Fixed Versions
  1. 1.9
Component
  1. IoC System
  2. Testing Infrastructure

Description

The IoC Testing framework seems to have been designed before "listener boiling" was a commonplace feature of the IoC framework itself. As a result, it has a peculiar syntax for supplying varying arguments to "event" fixtures, involving the "listenerMaker" and "makerArgs" values. For example, from the metadata component's tests, we have the following:

gpii.tests.bindDialog.makeEventChecker = function (eventName) {
return function () {
jqUnit.assert("The " + eventName + " event was fired.");
};
};

with a fixture entry
{
listenerMaker: "gpii.tests.bindDialog.makeEventChecker",
makerArgs: ["onBindDialogHandlers"],
event: "{bindDialog}.events.onBindDialogHandlers"
}

There's no good reason for this unusual record naming, as well as the redundant level of "return function () {}" in the fixture entry - this should instead be

gpii.tests.bindDialog.checkEvent = function (eventName) {
jqUnit.assert("The " + eventName + " event was fired.");
};

with

{
event: "{bindDialog}.events.onBindDialogHandlers"
listener: "gpii.tests.bindDialog.checkEvent",
args: "onBindDialogHandlers"
}

Comments