mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-02 05:03:44 +08:00
removed switch statement
This commit is contained in:
parent
607c0fcb5c
commit
7bf11f41d1
@ -83,27 +83,12 @@ interface ContentProps {
|
||||
const getTestsByTypeMap = (result: any) => {
|
||||
const testsByType: Map<string, any> = new Map();
|
||||
result.assertionResults.forEach((assertion: any) => {
|
||||
// using switch to allow for new types to be added
|
||||
switch (assertion.status) {
|
||||
case StatusTypes.PASSED_TYPE:
|
||||
testsByType.set(
|
||||
StatusTypes.PASSED_TYPE,
|
||||
testsByType.get(StatusTypes.PASSED_TYPE)
|
||||
? testsByType.get(StatusTypes.PASSED_TYPE).concat(assertion)
|
||||
: [assertion]
|
||||
);
|
||||
break;
|
||||
case StatusTypes.FAILED_TYPE:
|
||||
testsByType.set(
|
||||
StatusTypes.FAILED_TYPE,
|
||||
testsByType.get(StatusTypes.FAILED_TYPE)
|
||||
? testsByType.get(StatusTypes.FAILED_TYPE).concat(assertion)
|
||||
: [assertion]
|
||||
);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
testsByType.set(
|
||||
assertion.status,
|
||||
testsByType.get(assertion.status)
|
||||
? testsByType.get(assertion.status).concat(assertion)
|
||||
: [assertion]
|
||||
);
|
||||
});
|
||||
return testsByType;
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React, { Component, Fragment, useState } from 'react';
|
||||
import { styled } from '@storybook/theming';
|
||||
import { styled, themes, convert } from '@storybook/theming';
|
||||
import { Icons } from '@storybook/components';
|
||||
import Message from './Message';
|
||||
|
||||
@ -70,7 +70,7 @@ export function Result(props: ResultProps) {
|
||||
<Icon
|
||||
icon="chevrondown"
|
||||
size={10}
|
||||
color="#9DA5AB"
|
||||
color={convert(themes.normal).color.mediumdark}
|
||||
style={{
|
||||
transform: `rotate(${isOpen ? 0 : -90}deg)`,
|
||||
}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user