Closed Bug 1521752 Opened 11 months ago Closed 8 months ago

Add test for toolbox's DebugTargetInfo component


(DevTools :: about:debugging, enhancement, P1)



(firefox68 fixed)

Firefox 68
Tracking Status
firefox68 --- fixed


(Reporter: ladybenko, Assigned: jdescottes)


(Blocks 1 open bug)



(3 files, 1 obsolete file)

We need to test that the DebugTargetInfo in the toolbox renders the right information according to UX specs (see:

Priority: -- → P2
Assignee: nobody → dakatsuka
Priority: P2 → P1
Assignee: dakatsuka → nobody
Priority: P1 → P2

The goal of this bug is to write a UI unit test using Jest, to avoid having to setup a complex mochitests.
In our codebase today, only the debugger has Jest unit tests written I believe. They are currently working on running them on try.

Assignee: nobody → jdescottes
Priority: P2 → P1

This is more of a feedback request, I have not really written component unit tests before.

Depends on D24145. Just attaching for now as a POC. Will discuss on the bug to see how we want to organize this.

Some questions for Andrew and Jason about running additional Jest tests on try:

We are adding a new Jest test in devtools, outside of the debugger/ directory. For now I haven't really tried to merge this at all with what is done for the debugger. In, I added another CI task to run this other test, similar to the debugger one.

I imagine we want to limit the number of tasks here? Should we aim for:

  • a single task that runs all DevTools tests (debugger tests/flow/lint included)
  • keep Debugger and DevTools tasks separated

Since the debugger is still developed both in m-c and Github, maybe the second option is preferable?

We should also start thinking about how we organize our package.json files inside /devtools as more panels will start writing Jest tests. But I think this can wait for a follow up.

Flags: needinfo?(jlaster)
Flags: needinfo?(ahal)

I would prefer keeping the debugger and devtools separate for now.

  1. our runner/reporter needs some work (
  2. the debugger jest tests have some interesting config (see jest.config.js), which include the babel step

There is nothing keeping us from consolidating this in the future.

Flags: needinfo?(jlaster)

Another benefit of keeping them separate is that the tasks are set to run only when certain files change, so we can run fewer tests this way (though setup/teardown might negate some of this). I don't think we need to worry about limiting tasks too much.

Otherwise I don't really have much of a preference here.

Flags: needinfo?(ahal)

Thanks for the feedback! Happy to keep debugger & devtools separate for now. Will update the patch shortly.

Additional question: I am trying to add a small developer documentation. I know how to select the debugger/devtools jest tests when pushing to try via ./mach try fuzzy. But I don't know how to do it when using the classic try syntax? Any idea?

Flags: needinfo?(ahal)

Depends on D24146. We are adding new devtools unit tests using jest.
They share a list of globals made available in the environment by Jest, so using a shared eslintrc would make sense here.

Attachment #9053289 - Attachment is obsolete: true
Pushed by
Add jest test for framework component DebugTargetInfo;r=ladybenko
Run other DevTools jest tests on try;r=jlast,ahal
Create jest test for aboutdebugging-new Message component;r=ladybenko

No, I'm not sure what the syntax is. I think you'd have to use the largely unknown -j option.

Flags: needinfo?(ahal)
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
Bug 1521752 - Add jest test for framework component DebugTargetInfo;r=ladybenko
Bug 1521752 - Run other DevTools jest tests on try;r=jlast,ahal
Bug 1521752 - Create jest test for aboutdebugging-new Message component;r=ladybenko
You need to log in before you can comment on or make changes to this bug.