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(ui): add tests tab indicator #265

Merged
merged 4 commits into from
Oct 1, 2024
Merged

Conversation

kobenguyent
Copy link
Collaborator

No tests
Screenshot 2024-10-01 at 11 36 39

All passed
Screenshot 2024-10-01 at 11 36 43

Failed tests
Screenshot 2024-10-01 at 11 36 47

Copy link

netlify bot commented Oct 1, 2024

Deploy Preview for chimerical-kitsune-a0bfa0 ready!

Name Link
🔨 Latest commit dd9712c
🔍 Latest deploy log https://app.netlify.com/sites/chimerical-kitsune-a0bfa0/deploys/66fc12a615cbdb0008a1e62a
😎 Deploy Preview https://deploy-preview-265--chimerical-kitsune-a0bfa0.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@flawiddsouza
Copy link
Owner

No indicator is shown if all tests fail
image
this is because of v-if triggering only when passedTestCases value is greater than 0.
image
Indicator should actually be shown if there are any test cases > 0, regardless of fail or pass.

This should be a computed property.
image

Also this if guard is needed:
image
Because there are some old responses where testResults property is missing. So when you open those requests, the response panel will error out without this condition.

Restore the spacing before and after flower brackets here:
image

@flawiddsouza
Copy link
Owner

isTestResultsAvailable() {
    return this.response && 'testResults' in this.response || false
}

|| false is not required - as the result of that expression will be true or false

Both of these methods can be moved to computed properties:
image

@kobenguyent
Copy link
Collaborator Author

isTestResultsAvailable() {
    return this.response && 'testResults' in this.response || false
}

|| false is not required - as the result of that expression will be true or false

Both of these methods can be moved to computed properties: image

just curious if there is any case this.response would be null? That's why I added || false

@flawiddsouza flawiddsouza merged commit 58dacbf into main Oct 1, 2024
6 checks passed
@flawiddsouza flawiddsouza deleted the feat-tests-indicator branch October 1, 2024 16:13
@flawiddsouza
Copy link
Owner

just curious if there is any case this.response would be null? That's why I added || false

this.response can be null. I actually assumed the result of a statement with && would be a boolean but guess not:

image

Your code was correct.
image

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.

2 participants