-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Addon-jest: UI Redesign #7424
Addon-jest: UI Redesign #7424
Conversation
…similar to the accessibility addon for a more cohesive experience
…o add color to the expected and received values
Removed console log
…/storybook into feature/jest-redesign
…unction that returns an object
…s (ex. no longer checking for expected/result/etc.). Made it backwards compatible with previous result format.
…(one included breaks between title and value and the other outputs both in one line)
…eature/jest-redesign # Conflicts: # package.json # yarn.lock
👏 This looks amazing @CodeByAlex! Things I noticed from a visual design POV:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome improvement -- this is so much better! 💯
Left a couple code changes. The unit tests are for documentation more than anything in this case, I'm assuming they work.
return [msg]; | ||
}; | ||
|
||
const getConvertedText: (msg: string) => MsgElement[] = (msg: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a couple unit tests for this?
return elementArray; | ||
}; | ||
|
||
const getTestDetail: (msg: string) => TestDetail = (msg: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a couple unit tests for this?
) : null} | ||
</SuiteHead> | ||
<TabsState initial="failing-tests" backgroundColor="rgba(0,0,0,.05)"> | ||
<div id="failing-tests" title={`${failedNumber} Failed`} color="#FF4400"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use the theme colors rather than being hardcoded in.
})} | ||
</List> | ||
</div> | ||
<div id="passing-tests" title={`${successNumber} Passed`} color="#66BF3C"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Theme colors 🙏
<Icon | ||
icon="chevrondown" | ||
size={10} | ||
color="#9DA5AB" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
theme.color.mediumdark
…storybook into feature/jest-redesign
{tests ? ( | ||
<ContentWithTheme tests={tests} /> | ||
) : ( | ||
<NoTests>This story has no tests configured</NoTests> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to add some documentation here, on how to get it set up so there ARE tests.
icon="chevrondown" | ||
size={10} | ||
color="#9DA5AB" | ||
style={{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be in a rotate
prop.
Code looks good as is, some improvements would be good, but I'd be ok merging as is, and improving it later. |
# Conflicts: # yarn.lock
@ndelangen Sounds good. I can definitely add more tests, docs, and tweaks in the next PR based on these comments if that works for everyone. Would like to get feedback as soon as possible from users. |
Should be easy to add a few extra tabs for those types of tests reports I think. Would you be interested in contributing that feature @fabiradi ? |
😃 I actually thought about it and already took a peek into the source code. The counts are "simple" filters on strings and should be easy to duplicate for a couple of more tabs – fixing the wrong "failed" count. const successNumber = result.assertionResults
.filter(({ status }) => status === 'passed').length;
const failedNumber = result.assertionResults.length - successNumber; I have three questions up front:
👋 As this would be my first contribution, I still have to take a look into the contribution guide... |
@fabiradi That sounds great! You can check out the brand colors here: https://storybook-design-system.netlify.com/?path=/docs/design-system-color--all Looking forward to seeing this addition 👍 |
What I did
Redesigned and refactored the Jest addon to follow the pattern of the accessibility addon.
Parsing now works with new jest output format as well as the old format.
Continuation of #7395
There is more data coming to this addon but this is just a redesign.
Desktop, tablet, and wide phones [UPDATED]:
Mobile [UPDATED]:
How to test
If your answer is yes to any of these, please make sure to include it in your PR.