FLUID-6405: IoC Testing Framework expands listeners early even as it expands events late

Metadata

Source
FLUID-6405
Type
Bug
Priority
Major
Status
Open
Resolution
N/A
Assignee
Antranig Basman
Reporter
Antranig Basman
Created
2019-10-02T18:25:32.009-0400
Updated
2024-07-19T08:01:19.964-0400
Versions
N/A
Fixed Versions
N/A
Component
  1. Testing Infrastructure

Description

The IoC testing framework includes a "special dispensation" to allow event specifications to make use of IoCSS expressions to refer to components which are not instantiated at the point of executing the test sequence step. Unfortunately it still uses an eager expansion for "listener" as seen in the snippet

fluid.test.decoders.event = function (testCaseState, fixture) {
        var analysed = fluid.analyseTarget(testCaseState, fixture.event, "events");
        var listener = fluid.test.decodeListener(testCaseState, fixture);

"analyseTarget" is capable of parsing full selector contexts whereas "decodeListener" will attempt to evaluate the listener there and then.

In writing some test cases for BULBILS, Colin wrote the following

{
                            event: "{app ipcHolder windough}.events.afterShow",
                            listener: "{app ipcHolder ipc}.send",
                            args: ["from main"]
                        },

which failed with "Failed to resolve reference {app ipcHolder ipc}.send - could not match context with name app ipcHolder ipc from component { typeName: "electron.tests.ipcTester""