Skip to content

Commit

Permalink
removed mass null check condition and added single check to add place…
Browse files Browse the repository at this point in the history
…holder if true
  • Loading branch information
CodeByAlex committed Aug 17, 2019
1 parent a73bae2 commit 247a0ef
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions addons/jest/src/components/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const getColorByType = (type: string) => {
const Content = styled(({ tests, className }: ContentProps) => (
<div className={className}>
{tests.map(({ name, result }) => {
if (!result) {
if (!result || !result.assertionResults) {
return (
<Placeholder key={name}>
This story has tests configured, but no file was found
Expand All @@ -126,10 +126,6 @@ const Content = styled(({ tests, className }: ContentProps) => (
const entries: any = testsByType.entries();
const sortedTestsByCount = [...entries].sort((a, b) => a[1].length - b[1].length);

if (!entries && !sortedTestsByCount && !result.assertionResults) {
return null;
}

return (
<SizeMe refreshMode="debounce" key={name}>
{({ size }: { size: any }) => {
Expand Down

0 comments on commit 247a0ef

Please sign in to comment.