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

feat: Filtering UI down to Individual test blocks #3505

Closed
wants to merge 11 commits into from

Conversation

g4rry420
Copy link
Contributor

@g4rry420 g4rry420 commented Jun 4, 2023

Resolves: #3109

I have considered two ways to add this functionality:

  • In first method, we will get index and nestedIndex of items when user clicks on test name and if the that indexes are present then we will show that code block. Potential Issue: If the test file is not formatted properly, i.e, starting and ending of test block on the same line, then it might not work
  • Second Method (fallback) - Here, based on the test name, we will search for that test and filter the string block for that test. Potential issue with this fallback method is that if there are two tests with the same name, then it will show the test block whose name comes first in the string.

There is also Codemirror add-ons for code folding which can be useful for this feature, but I haven't taken a deep look into it. https://codemirror.net/docs/ref/#language.foldCode

Video:
https://www.loom.com/share/9fdbf88ef5114b2fa76e45b119b31e61

Disclaimer: I am coming from React background, so I am learning Vue on the go, please let me know if I am missing best practices specific to Vue

Also, when I was trying to make commit, I am facing this eslint error, not sure why that occurred, so I have commited the files with -n flag.
Screenshot 2023-06-04 003953

@stackblitz
Copy link

stackblitz bot commented Jun 4, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@userquin
Copy link
Member

userquin commented Jun 4, 2023

run nr lint in your local, there are a few lint errors, check Files changed tab.

packages/ui/client/components/TaskItem.vue Outdated Show resolved Hide resolved
/>
<div>
<IconButton
v-if="testIndex !== null || isDescribeBlock !== null || selectedTest !== null"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create a computed property that holds this to avoid duplicate.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

@g4rry420 g4rry420 requested a review from dammy001 June 16, 2023 19:34
@dammy001
Copy link
Member

@userquin take a look at this again.

@netlify
Copy link

netlify bot commented Jul 27, 2023

Deploy Preview for fastidious-cascaron-4ded94 canceled.

Name Link
🔨 Latest commit 6fa3034
🔍 Latest deploy log https://app.netlify.com/sites/fastidious-cascaron-4ded94/deploys/65a94f1b808a4e0008821e43

@sheremet-va
Copy link
Member

This is implemented in #5948

@sheremet-va sheremet-va closed this Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow filtering UI down to individual blocks/tests
4 participants