1
1
<template >
2
2
<div class =" flex h-6 text-gray-500 border border-gray-200 rounded text-size-14px leading-20px" >
3
- <div class =" flex items-center px-2 hover:bg-indigo-50" >
4
- <i-cy-status-flaky _x12 class =" mr-1 h-12px w-12px icon-dark-gray-400" />
5
- 0
6
- <!--
7
- TODO: Is flake even exposed via the API?
8
- {{props.gql.totalFlake}}
9
- -->
10
- </div >
11
- <div class =" flex items-center px-2 hover:bg-indigo-50" >
12
- <i-cy-status-skipped _x12 class =" mr-1 h-12px w-12px icon-dark-gray-400" />
13
- {{ props.gql.totalSkipped }}
14
- </div >
15
- <div class =" flex items-center px-2 hover:bg-indigo-50" >
16
- <i-cy-status-pending _x12 class =" mr-1 h-12px w-12px icon-dark-gray-400 icon-light-white" />
17
- {{ props.gql.totalPending }}
18
- </div >
19
- <div class =" flex items-center px-2 hover:bg-indigo-50" >
20
- <i-cy-status-passed _x12 class =" mr-1 h-12px w-12px icon-dark-jade-400" />
21
- {{ props.gql.totalPassed }}
22
- </div >
23
- <div class =" flex items-center px-2 hover:bg-indigo-50" >
24
- <i-cy-status-failed _x12 class =" mr-1 h-12px w-12px icon-dark-red-400" />
25
- {{ props.gql.totalFailed }}
3
+ <div
4
+ v-for =" (result, i) in results"
5
+ :key =" i"
6
+ class =" flex items-center px-2 hover:bg-indigo-50"
7
+ >
8
+ <component
9
+ :is =" result.icon"
10
+ class =" mr-1 h-12px w-12px"
11
+ :class =" result.color"
12
+ />
13
+ {{ result.value }}
26
14
</div >
27
15
</div >
28
16
</template >
29
17
30
18
<script lang="ts" setup>
31
19
import type { RunResultsFragment } from ' ../generated/graphql'
32
20
import { gql } from ' @urql/core'
21
+ import FlakyIcon from ' ~icons/cy/status-flaky_x12.svg'
22
+ import SkippedIcon from ' ~icons/cy/status-skipped_x12.svg'
23
+ import PassedIcon from ' ~icons/cy/status-passed_x12.svg'
24
+ import FailedIcon from ' ~icons/cy/status-failed_x12.svg'
25
+ import PendingIcon from ' ~icons/cy/status-pending_x12.svg'
33
26
34
27
gql `
35
28
fragment RunResults on CloudRun {
@@ -38,11 +31,40 @@ fragment RunResults on CloudRun {
38
31
totalFailed
39
32
totalPending
40
33
totalSkipped
41
- totalDuration
42
34
}
43
35
`
44
36
45
37
const props = defineProps <{
46
38
gql: RunResultsFragment
47
39
}>()
40
+
41
+ const results = [
42
+ {
43
+ // TODO: Is flake even exposed via the API?
44
+ // value: props.gql.totalFlaky,
45
+ value: 0 ,
46
+ color: ' icon-dark-gray-400' ,
47
+ icon: FlakyIcon ,
48
+ },
49
+ {
50
+ value: props .gql .totalSkipped ,
51
+ color: ' icon-dark-gray-400' ,
52
+ icon: SkippedIcon ,
53
+ },
54
+ {
55
+ value: props .gql .totalPending ,
56
+ color: ' icon-dark-gray-400 icon-light-white' ,
57
+ icon: PendingIcon ,
58
+ },
59
+ {
60
+ value: props .gql .totalPassed ,
61
+ color: ' icon-dark-jade-400' ,
62
+ icon: PassedIcon ,
63
+ },
64
+ {
65
+ value: props .gql .totalFailed ,
66
+ color: ' icon-dark-red-400' ,
67
+ icon: FailedIcon ,
68
+ },
69
+ ]
48
70
</script >
0 commit comments