TestResultEntry.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <div>
  3. <span
  4. v-if="testResults.description"
  5. class="flex font-bold text-secondaryDark py-2 px-4 items-center"
  6. >
  7. {{ testResults.description }}
  8. </span>
  9. <div v-if="testResults.expectResults" class="divide-y divide-dividerLight">
  10. <HttpTestResultReport
  11. v-if="testResults.expectResults.length"
  12. :test-results="testResults"
  13. />
  14. <div
  15. v-for="(result, index) in testResults.expectResults"
  16. :key="`result-${index}`"
  17. class="flex py-2 px-4 items-center"
  18. >
  19. <i
  20. class="mr-4 material-icons"
  21. :class="result.status === 'pass' ? 'text-green-500' : 'text-red-500'"
  22. >
  23. {{ result.status === "pass" ? "check" : "close" }}
  24. </i>
  25. <span v-if="result.message" class="text-secondaryDark">
  26. {{ result.message }}
  27. </span>
  28. <span class="text-secondaryLight">
  29. {{
  30. ` \xA0 — \xA0 ${
  31. result.status === "pass" ? $t("test.passed") : $t("test.failed")
  32. }`
  33. }}
  34. </span>
  35. </div>
  36. </div>
  37. </div>
  38. </template>
  39. <script setup lang="ts">
  40. import { PropType } from "@nuxtjs/composition-api"
  41. import { HoppTestResult } from "~/helpers/types/HoppTestResult"
  42. defineProps({
  43. testResults: {
  44. type: Object as PropType<HoppTestResult>,
  45. required: true,
  46. },
  47. })
  48. </script>