Jess 7952647601
feat: adding ui component tests (#590)
* docs: additional cypress + vitest comparison content

* feat: ui testing

* fix: seperate cypress tests

* feat: adding cypress component testing for ui

* chore: share the common deps for global app setup

* spacing

* Update package.json

Co-authored-by: Michel EDIGHOFFER <edimitchel@gmail.com>

* chore: adding OptimizationPersist + PkgConfig to reduce flake

* chore: workaround for unocss hmr

* chore: adding ts-ignore comments

* chore: reordering data-testid

* chore: ts-expect-error

* --allow-empty

* bug: reproduction of failing vite + cypress setup

* chore: adding Vite 2.9.0-beta.3 to cold-start stability issues for UI component tests

* chore: fixing types

* chore: fixing types

* reenabling tests

* adding faker seed back in

* bumping faker version

Co-authored-by: Michel EDIGHOFFER <edimitchel@gmail.com>
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
2022-03-21 19:18:44 +08:00

59 lines
1.6 KiB
Vue

<script setup lang="ts">
import { tests, testsFailed, testsSkipped, testsSuccess, testsTodo } from '../../composables/summary'
const total = computed(() => tests.value.length)
const pass = computed(() => testsSuccess.value.length)
const failed = computed(() => testsFailed.value.length)
const skipped = computed(() => testsSkipped.value.length)
const todo = computed(() => testsTodo.value.length)
const pending = computed(() => {
const t = unref(total)
return t - failed.value - pass.value
})
</script>
<template>
<div flex="~ wrap" justify-evenly gap-2 p="x-4" relative>
<DashboardEntry text-green5 data-testid="pass-entry">
<template #header>
Pass
</template>
<template #body>
{{ pass }}
</template>
</DashboardEntry>
<DashboardEntry :class="{ 'text-red5': failed, 'op50': !failed }" data-testid="fail-entry">
<template #header>
Fail
</template>
<template #body>
{{ failed }}
</template>
</DashboardEntry>
<DashboardEntry v-if="skipped" op50 data-testid="skipped-entry">
<template #header>
Skip
</template>
<template #body>
{{ skipped }}
</template>
</DashboardEntry>
<DashboardEntry v-if="todo" op50 data-testid="todo-entry">
<template #header>
Todo
</template>
<template #body>
{{ todo }}
</template>
</DashboardEntry>
<DashboardEntry :tail="true" data-testid="total-entry">
<template #header>
Total
</template>
<template #body>
{{ total }}
</template>
</DashboardEntry>
</div>
</template>