Closed Bug 1550791 Opened 5 years ago Closed 5 years ago

WebConsole mocha tests are failing with `TypeError: dispatch is not a function`

Categories

(DevTools :: Console, defect, P1)

defect

Tracking

(firefox68 fixed)

RESOLVED FIXED
Firefox 68
Tracking Status
firefox68 --- fixed

People

(Reporter: jdescottes, Assigned: nchevobbe)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

Regression from Bug 1230194, precisely part 3 https://hg.mozilla.org/mozilla-central/rev/26b7736f1f87

I will disable the necessary tests in order to be able to move back the devtools node test suite as tier 1 in Bug 1535484

Hi Nicolas, I am skipping the following mocha test:

  it("displays a [Learn more] link", () => {
    const store = setupStore();

    const message = stubPreparedMessages.get("asdf()");

    serviceContainer.openLink = sinon.spy();
    const wrapper = mount(
      Provider({ store }, EvaluationResult({ message, serviceContainer }))
    );

    const url =
      "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Not_defined";
    const learnMore = wrapper.find(".learn-more-link");
    expect(learnMore.length).toBe(1);
    expect(learnMore.prop("title")).toBe(url);

    learnMore.simulate("click");
    const call = serviceContainer.openLink.getCall(0);
    expect(call.args[0]).toEqual(message.exceptionDocURL);
  });

from https://searchfox.org/mozilla-central/rev/b418634cb3fe83ebb8d2c019cc1ba76974da1a0d/devtools/client/webconsole/test/components/evaluation-result.test.js#43

The failure log is

  1) EvaluationResult component:
       displays a [Learn more] link:
     TypeError: dispatch is not a function
      at Message.toggleMessage (/Users/jdescottes/Development/hg/fx-team/devtools/client/webconsole/components/Message.js:117:7)
      at Object.invokeGuardedCallback (/Users/jdescottes/Development/hg/fx-team/devtools/client/shared/vendor/react-dom.js:77:10)
      at Object.invokeGuardedCallback (/Users/jdescottes/Development/hg/fx-team/devtools/client/shared/vendor/react-dom.js:107:27)
      at Object.invokeGuardedCallbackAndCatchFirstError (/Users/jdescottes/Development/hg/fx-team/devtools/client/shared/vendor/react-dom.js:121:43)
      at executeDispatch (/Users/jdescottes/Development/hg/fx-team/devtools/client/shared/vendor/react-dom.js:399:19)
      at executeDispatchesInOrder (/Users/jdescottes/Development/hg/fx-team/devtools/client/shared/vendor/react-dom.js:415:7)
      at executeDispatchesAndRelease (/Users/jdescottes/Development/hg/fx-team/devtools/client/shared/vendor/react-dom.js:516:5)
      at executeDispatchesAndReleaseSimulated (/Users/jdescottes/Development/hg/fx-team/devtools/client/shared/vendor/react-dom.js:524:10)
      at forEachAccumulated (/Users/jdescottes/Development/hg/fx-team/devtools/client/shared/vendor/react-dom.js:497:8)
      at Object.runEventsInBatch (/Users/jdescottes/Development/hg/fx-team/devtools/client/shared/vendor/react-dom.js:656:5)
      at /Users/jdescottes/Development/hg/fx-team/devtools/client/shared/vendor/react-dom-test-utils-dev.js:1184:22
      at Object.batchedUpdates$1 [as unstable_batchedUpdates] (/Users/jdescottes/Development/hg/fx-team/devtools/client/shared/vendor/react-dom.js:13458:12)
      at /Users/jdescottes/Development/hg/fx-team/devtools/client/shared/vendor/react-dom-test-utils-dev.js:1180:14
      at Object.simulateEvent (node_modules/enzyme-adapter-react-16/build/ReactSixteenAdapter.js:492:15)
      at ReactWrapper.<anonymous> (node_modules/enzyme/build/ReactWrapper.js:953:29)
      at ReactWrapper.single (node_modules/enzyme/build/ReactWrapper.js:1720:25)
      at ReactWrapper.simulate (node_modules/enzyme/build/ReactWrapper.js:952:21)
      at Context.it (components/evaluation-result.test.js:116:15)

Flags: needinfo?(nchevobbe)

Thanks Julian, I'm going to fix this

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Flags: needinfo?(nchevobbe)

The test was disabled in Bug 1535484 because it was failing.
To fix the test, we need to pass a dispatch prop to the
EvaluationResult component.

Priority: -- → P1
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/83c6540f1fc1
Re-enable commented mocha test. r=jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
Has Regression Range: --- → yes
Keywords: regression
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: