Uploaded image for project: 'Fluid Infusion'
  1. Fluid Infusion
  2. FLUID-5496

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

    XMLWordPrintable

    Details

      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"
      }

        Attachments

          Activity

            People

            Assignee:
            antranig Antranig Basman
            Reporter:
            antranig Antranig Basman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: