Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collapsable Test Groups #37

Closed
duckbrain opened this issue Feb 25, 2020 · 7 comments · Fixed by #46
Closed

Collapsable Test Groups #37

duckbrain opened this issue Feb 25, 2020 · 7 comments · Fixed by #46
Assignees
Labels
enhancement New feature or request

Comments

@duckbrain
Copy link

Is your feature request related to a problem? Please describe.
I have a few test suites (*.test.[tj]s files) that have over 100 tests that are grouped with the describe function. These tests go through a sequence of steps in a workflow and check to make sure each step is done correctly. Each describe group is a different iteration of the steps.

jest-html-reporters shows these flattened out to show "description -> test". When I expand one of the files that follow that workflow, I end up with a very long list of tests that are clipped by the describe name and the test is cut off.

Describe the solution you'd like
A way to collapse test groups the same way test suites are grouped together. with an expand button.

Describe alternatives you've considered
Splitting my test into smaller chunks of files. It doesn't make a lot of logical sense to do that in my case.

@duckbrain duckbrain added the enhancement New feature or request label Feb 25, 2020
@duckbrain
Copy link
Author

Related #6

@Hazyzh Hazyzh added this to the Version - (2.x) milestone Jun 9, 2020
@Hazyzh Hazyzh linked a pull request Jun 9, 2020 that will close this issue
@Hazyzh
Copy link
Owner

Hazyzh commented Jun 10, 2020

We know that this reporter just to display the data that we got form Jest. In fact, I have the same request as you, I don't want to show all test at one abstract level, but the data we get from Jest is a bit annoying, in the reporter's data they put all data in an array, not a tree-like structure Object.

here is an example.
structure example

The structure of my test file is

- Group 1
  - Sub Group 1
     - case 1
     - case 2
     - case 3
  - Sub Group 2
     - case 4
     - case 5
     - case 6

But the output data from Jest just put all tests in one array, not have any structure.

So the key point of this feature is how to combine those data into a tree-like structure.

@Hazyzh
Copy link
Owner

Hazyzh commented Jun 10, 2020

Follow above, In the Jest native data, there is one field we can use to combine data into a tree-like structure. it is the field ancestorTitle, it put all parents describe texts in an array, such as the ancestorTitle of test 1 is [group 1, sub group 1].

For now, I will use this field to combine data. it may not perfectly accurate if you set identical describe wordings, but it can cover most use cases.

so the current design is that if a test file has many test cases, it will show a Merge Data checkbox on the expanded table. You can check it to merge data and set the merge level to control how to combine those data.

for example,
if you set merge level as 1, it will show like this
level 1
set merge level as 2, it will show like this
level 2

@duckbrain do you have any suggestions about this? any comments welcome!

@duckbrain
Copy link
Author

Yeah, that looks nice.

I'd prefer to have the redundant prefix stripped from the test name as well, as that would address my original problem of the names being cut off.

@Hazyzh
Copy link
Owner

Hazyzh commented Jun 15, 2020

New version (2.0.0) released. You can have a try now.

@rootlinux2
Copy link

Hey, guys, it is possible to get the merge data checked as default?

@pgupta-dizvik
Copy link

pgupta-dizvik commented Dec 2, 2020

Hey, guys, it is possible to get the merge data checked as default?

Have you been able to find any solution for this to get merge data as checked by default?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants