diff --git a/addons/jest/src/components/Indicator.ts b/addons/jest/src/components/Indicator.ts index f9956f8273b3..ca042d586198 100644 --- a/addons/jest/src/components/Indicator.ts +++ b/addons/jest/src/components/Indicator.ts @@ -15,7 +15,7 @@ const Indicator = styled.div( ({ color, size }) => ({ boxSizing: 'border-box', padding: `0 ${size / 2}px`, - minWidth: size, + width: `fit-content`, minHeight: size, fontSize: size / 1.4, lineHeight: `${size}px`, diff --git a/addons/jest/src/components/Message.tsx b/addons/jest/src/components/Message.tsx index ff096e9e248c..757bcd7afd95 100644 --- a/addons/jest/src/components/Message.tsx +++ b/addons/jest/src/components/Message.tsx @@ -39,14 +39,14 @@ const StackTrace = styled(({ trace, className }: StackTraceProps) => ( ))} ))({ - background: 'silver', + background: '#e2e2e2', padding: 10, overflow: 'auto', }); const Main = styled(({ msg, className }) =>
{msg}
)({ padding: 10, - borderBottom: '1px solid silver', + borderBottom: '1px solid #e2e2e2', }); interface SubProps { diff --git a/addons/jest/src/components/Panel.tsx b/addons/jest/src/components/Panel.tsx index 28dc0266553c..6d9975bfd7c6 100644 --- a/addons/jest/src/components/Panel.tsx +++ b/addons/jest/src/components/Panel.tsx @@ -26,7 +26,8 @@ const NoTests = styled.div({ }); const FileTitle = styled.h2({ - margin: 0, + marginRight: '6px', + marginBottom: '3px', fontWeight: 500, fontSize: 18, }); @@ -64,9 +65,7 @@ const SuiteTotals = styled(({ successNumber, failedNumber, result, className }) const SuiteProgress = styled(({ successNumber, result, className }) => (
- - {`${(successNumber / result.assertionResults.length) * 100}%`} - +
))(() => ({ width: '100%', @@ -92,6 +91,12 @@ const SuiteProgress = styled(({ successNumber, result, className }) => ( const SuiteTitle = styled.div({ display: 'flex', alignItems: 'center', + marginBottom: '3px', +}); + +const PassingRate = styled.div({ + fontWeight: 500, + fontSize: '10px', }); interface ContentProps { @@ -102,29 +107,36 @@ interface ContentProps { const Content = styled(({ tests, className }: ContentProps) => (
{tests.map(({ name, result }) => { + const title = name || 'Result status'; + if (!result) { - return This story has tests configured, but no file was found; + return ( + This story has tests configured, but no file was found + ); } const successNumber = result.assertionResults.filter(({ status }) => status === 'passed') .length; const failedNumber = result.assertionResults.length - successNumber; - return ( -
+
+ + {`${title}:`} + + {result.status} + + - - - {result.status} - - {name} - - + {`Passing rate: ${( + (successNumber / result.assertionResults.length) * + 100 + ).toFixed(2)}%`} + {result.assertionResults.map(res => (