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 ui #183

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Commits on Feb 8, 2020

  1. added repeatable ID generation for jest elements

    This is the first step to collapsable describe blocks in the UI. This change modifies the way that Ids are assigned to the jest blocks that are passed to the UI. Before this change, every time the file was refreshed, the Id assigned to a block would be brand new and different. With this change we keep track of the Ids that have been assigned and we re-use them when we recognize that the element is the same as before.
    
    This will allow us in the UI to keep track of which describe blocks have been collapsed and when we revisit the page or rerun the tests, the describe blocks that were collapsed will remain collapsed.
    
    This is just the server side of that change.
    Greg Veres committed Feb 8, 2020
    Configuration menu
    Copy the full SHA
    8e440d5 View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2020

  1. Added collapsing describe blocks

    This checkin adds the ability to collapse the describe blocks for the test result. The collapsed state is stored per describe block in a static class and updated each time the user toggles a block. The collapse state storage is small, only storing data for the describe blocks that are actually toggled.
    When a test is re-run, if there are failures in a describe block that is collapsed, it is automatically opened.
    I also fixed the display of the status icon beside describe blocks. Before this change it was always green. Now it is red when one of its tests fail. I am pretty sure this was a bug before because as soon as I changed the status to failed for the describe block, it changed the colour to red, indicating that the testIndicator component already handled the case but wasn't being passed the correct values.
    
    I believe this change fits in with the style of the existing component. I retained the functional component style by using React hooks. Unexpectantly, I had to use the useEffect tied to changing of the results variable. This was necessary to get the describe block to open after a test run if a test within it failed.
    
    I also had to change the implementation of allChildrenPassing. it now recursively looks at the children where it didnt before.
    
    Also, I made it so that clicking on the entire bar collapsed or expands the block rather than just the +/- div.
    Greg Veres committed Feb 9, 2020
    Configuration menu
    Copy the full SHA
    89c04ac View commit details
    Browse the repository at this point in the history
  2. fixed issue where tests with the same name would share the same failu…

    …re results
    
    Since the UI was matching results with tests by the test title, it was picking the wrong test result for all but the the first test with the duplicated name.
    This fix uses the previous change for collapsing describe blocks. The Ids that the backend assigned to the tests, are propogated through to the UI with the test results with this change. This allows the UI to use the id to match the test results with the tests. The end result is that a user can have the same named test in multiple locations in the test file and the UI will always match up the correct results with the tests.
    
    The id field had to be added to the test item result entry and the queries the UI sends had to include the field.
    
    Assigning Ids to the tests in the test result is fairly efficient because it can use the property of the test results that tests are grouped by under their describe block. So on each iteration of the loop, we first check to see if the existing idManaager is still valid and if it is, we just use that one rather than searching for the right idManager to use.
    Greg Veres committed Feb 9, 2020
    Configuration menu
    Copy the full SHA
    8e67b5c View commit details
    Browse the repository at this point in the history

Commits on Apr 17, 2020

  1. added ability to click on an error and open the offending file in VSCode

    This adds the ability to quickly jump to the error in the source file on a failing test.
    This fixes issue Raathigesh#186
    Greg Veres committed Apr 17, 2020
    Configuration menu
    Copy the full SHA
    9fe44e4 View commit details
    Browse the repository at this point in the history