pairwise-tech / pairwise

The Pairwise Codebase
https://app.pairwise.tech
6 stars 0 forks source link

Enable Test Case Preview #248

Closed no-stack-dub-sack closed 4 years ago

no-stack-dub-sack commented 4 years ago

In #208 changes were made to opt-in to running challenge tests on initial load. As a result, since the workspace only "knows" what the test messages are after they've been run at least once, there was no way for the user to see the test cases they were meant to satisfy without running the tests.

This PR aims to improve UX by allowing the user to preview the test cases without requiring a test run (for non-markup challenges only). The idea is to use a regex to extract test messages from test code and create a set of "preview" test cases from these messages to set as the initial test result state. This required some minor refactoring to the TestResultRow component to properly show that the tests are in a default/non-run state.

How this looks: image

In action: demo

Other small changes:

no-stack-dub-sack commented 4 years ago

@iansinnott absolutely, was thinking about this as well. Will add this tomorrow.

no-stack-dub-sack commented 4 years ago

@iansinnott tests are added, let me know if you think this looks good. Thanks!

Also, just added a new commit which addresses some minor typos in the www package.