1
1
import { Button , Checkbox } from "antd"
2
- import { CSSProperties , useEffect , useState } from "react"
2
+ import { CSSProperties , useEffect , useState , Dispatch , SetStateAction } from "react"
3
3
import { AiOutlineReload } from "react-icons/ai"
4
4
import { BsFileEarmarkCheck } from "react-icons/bs"
5
5
import { FiChevronLeft , FiChevronRight } from "react-icons/fi"
6
6
import { GoFileCode } from "react-icons/go"
7
7
import { SiGoland } from "react-icons/si"
8
8
import { VscVscode } from "react-icons/vsc"
9
9
import { ProgressIcon } from "../../../support/components/icon/ProgressIcon"
10
+ import { TraceExplorer , TraceExplorerProps } from "../../../trace/TraceExplorer"
10
11
import TextEditor from "../../TextEditor"
11
12
import CopyClipboard from "../../support/CopyClipboard"
12
13
import Icon from "../../support/Icon"
13
14
import { TestingItem } from "../testing-api"
14
- import { RunStatus } from "../testing"
15
- import { TraceExplorer , TraceExplorerProps } from "../../../trace/TraceExplorer"
15
+ import { CoverageLine , CoverageLineProps } from "./Coverage"
16
16
17
17
export interface XgoTestDetailProps {
18
18
style ?: CSSProperties
@@ -23,7 +23,7 @@ export interface XgoTestDetailProps {
23
23
log ?: string
24
24
25
25
trace ?: boolean
26
- onTraceChange ?: React . Dispatch < React . SetStateAction < boolean > >
26
+ onTraceChange ?: Dispatch < SetStateAction < boolean > >
27
27
28
28
onClickRun ?: ( ) => void
29
29
onClickDebug ?: ( ) => void
@@ -37,25 +37,20 @@ export interface XgoTestDetailProps {
37
37
38
38
showTrace ?: boolean
39
39
shownTraceProps ?: TraceExplorerProps
40
+
41
+ coverage ?: CoverageLineProps
40
42
}
41
43
42
44
// debug with trace enabled
43
45
export function XgoTestDetail ( props : XgoTestDetailProps ) {
44
46
return < div className = { props . className } style = { { height : "100%" , ...props . style } } >
47
+ < div style = { { display : "flex" , alignItems : "center" } } >
48
+ < CoverageLine { ...props . coverage } />
49
+ </ div >
45
50
< ItemDetail { ...props } />
46
51
</ div >
47
52
}
48
53
49
- function getStatusColor ( status : RunStatus ) : string | undefined {
50
- if ( status == "fail" || status === "error" ) {
51
- return "red"
52
- }
53
- if ( status === "success" ) {
54
- return "green"
55
- }
56
- return undefined
57
- }
58
-
59
54
export function ItemDetail ( props : XgoTestDetailProps ) {
60
55
const item = props . item
61
56
if ( item == null ) {
0 commit comments