@@ -50,7 +46,7 @@ const transform = computed(() => {
isDark.value ? 'light' : 'dark')
+
function onItemClick(task: Task) {
activeFileId.value = task.id
currentModule.value = findById(task.id)
showDashboard(false)
}
-const toggleMode = computed(() => isDark.value ? 'light' : 'dark')
+
async function onRunAll(files?: File[]) {
if (coverageEnabled.value) {
disableCoverage.value = true
diff --git a/packages/ui/client/components/TaskTree.vue b/packages/ui/client/components/TaskTree.vue
index d9b88b34b72d..094d458fdd8c 100644
--- a/packages/ui/client/components/TaskTree.vue
+++ b/packages/ui/client/components/TaskTree.vue
@@ -2,22 +2,15 @@
import type { Task } from '#types'
import { caseInsensitiveMatch } from '~/utils/task'
-withDefaults(defineProps<{
+defineOptions({ inheritAttrs: false })
+
+const { task, indent = 0, nested = false, search, onItemClick } = defineProps<{
task: Task
indent?: number
nested?: boolean
search?: string
onItemClick?: (task: Task) => void
-}>(), {
- indent: 0,
- nested: false,
-})
-
-
-
diff --git a/packages/ui/client/components/TasksList.vue b/packages/ui/client/components/TasksList.vue
index c73735385ffd..95d7fe9d21c1 100644
--- a/packages/ui/client/components/TasksList.vue
+++ b/packages/ui/client/components/TasksList.vue
@@ -5,53 +5,30 @@ import { findById, testRunState } from '~/composables/client'
import { activeFileId } from '~/composables/params'
import { caseInsensitiveMatch, isSuite } from '~/utils/task'
-const props = withDefaults(defineProps<{
+defineOptions({ inheritAttrs: false })
+
+// eslint-disable-next-line unused-imports/no-unused-vars
+const { tasks, indent = 0, nested = false, groupByType = false, onItemClick } = defineProps<{
tasks: Task[]
indent?: number
nested?: boolean
groupByType?: boolean
onItemClick?: (task: Task) => void
-}>(), {
- indent: 0,
- groupByType: false,
- nested: false,
-})
+}>()
const emit = defineEmits<{
(event: 'run', files?: File[]): void
}>()
-const search = ref('')
+const search = ref('')
const searchBox = ref()
const isFiltered = computed(() => search.value.trim() !== '')
-function matchTasks(tasks: Task[], search: string): boolean {
- let result = false
-
- for (let i = 0; i < tasks.length; i++) {
- const task = tasks[i]
-
- if (caseInsensitiveMatch(task.name, search)) {
- result = true
- break
- }
-
- // walk whole task tree
- if (isSuite(task) && task.tasks) {
- result = matchTasks(task.tasks, search)
- if (result)
- break
- }
- }
-
- return result
-}
-
const filtered = computed(() => {
if (!search.value.trim())
- return props.tasks
+ return tasks
- return props.tasks.filter(task => matchTasks([task], search.value))
+ return tasks.filter(task => matchTasks([task], search.value))
})
const filteredTests: ComputedRef = computed(() => isFiltered.value ? filtered.value.map(task => findById(task.id)!).filter(Boolean) : [])
@@ -63,20 +40,36 @@ const running = computed(() => filtered.value.filter(task =>
&& !success.value.includes(task)
&& !skipped.value.includes(task),
))
+
+const disableClearSearch = computed(() => search.value === '')
+
const throttledRunning = useThrottle(running, 250)
function clearSearch(focus: boolean) {
search.value = ''
focus && searchBox.value?.focus()
}
-const disableClearSearch = computed(() => {
- return search.value === ''
-})
-
-
diff --git a/packages/ui/client/components/views/ViewConsoleOutputEntry.vue b/packages/ui/client/components/views/ViewConsoleOutputEntry.vue
index 3decab219211..07fc92dcf711 100644
--- a/packages/ui/client/components/views/ViewConsoleOutputEntry.vue
+++ b/packages/ui/client/components/views/ViewConsoleOutputEntry.vue
@@ -1,7 +1,7 @@