fix: resolve lint errors and test failure in Phase 3

- Fix vue/no-useless-mustaches: use i18n interpolation for running/queued
  labels instead of separate span + mustache space
- Fix @intlify/vue-i18n/no-raw-text: use i18n key for NEW badge text
- Fix JobGroupsList.test.ts: add createTestingPinia and mock
  useConcurrentExecution to resolve Pinia initialization error
This commit is contained in:
bymyself
2026-03-12 08:50:22 -07:00
parent 7adfaeb012
commit 3b10e97dbb
4 changed files with 23 additions and 13 deletions

View File

@@ -37,10 +37,7 @@
class="flex items-center gap-1 rounded-lg bg-secondary-background px-2 py-1"
>
<span class="text-sm font-normal tabular-nums">
<span class="text-primary-foreground">{{
n(runningCount)
}}</span>
{{ ' ' }}{{ t('menu.running') }}
{{ t('menu.nRunning', { count: n(runningCount) }) }}
</span>
<Button
v-tooltip.bottom="cancelJobTooltipConfig"
@@ -57,10 +54,7 @@
class="flex items-center gap-1 rounded-lg bg-secondary-background px-2 py-1"
>
<span class="text-sm font-normal tabular-nums">
<span class="text-primary-foreground">{{
n(queuedCount)
}}</span>
{{ ' ' }}{{ t('menu.queued') }}
{{ t('menu.nQueued', { count: n(queuedCount) }) }}
</span>
<Button
v-tooltip.bottom="clearQueueTooltipConfig"

View File

@@ -70,7 +70,10 @@
<span class="text-sm text-text-primary">{{
t('menu.parallelExecution')
}}</span>
<StatusBadge label="NEW" class="text-[10px]" />
<StatusBadge
:label="t('menu.parallelNew')"
class="text-[10px]"
/>
</div>
<span class="text-xs text-text-muted">{{
t('menu.parallelUpTo', { count: maxConcurrentJobs })

View File

@@ -1,11 +1,19 @@
import { createTestingPinia } from '@pinia/testing'
import { mount } from '@vue/test-utils'
import { afterEach, describe, expect, it, vi } from 'vitest'
import { setActivePinia } from 'pinia'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { defineComponent, nextTick } from 'vue'
import JobGroupsList from '@/components/queue/job/JobGroupsList.vue'
import type { JobGroup, JobListItem } from '@/composables/queue/useJobList'
import type { TaskItemImpl } from '@/stores/queueStore'
vi.mock('@/composables/useConcurrentExecution', () => ({
useConcurrentExecution: () => ({
isConcurrentExecutionEnabled: { value: false }
})
}))
const QueueJobItemStub = defineComponent({
name: 'QueueJobItemStub',
props: {
@@ -56,6 +64,10 @@ const mountComponent = (groups: JobGroup[]) =>
}
})
beforeEach(() => {
setActivePinia(createTestingPinia({ stubActions: false }))
})
afterEach(() => {
vi.useRealTimers()
})

View File

@@ -1004,10 +1004,11 @@
"help": "Help",
"queue": "Queue Panel",
"fullscreen": "Fullscreen",
"running": "running",
"queued": "queued",
"nRunning": "{count} running",
"nQueued": "{count} queued",
"parallelExecution": "Run jobs in parallel",
"parallelUpTo": "Up to {count}"
"parallelUpTo": "Up to {count}",
"parallelNew": "NEW"
},
"tabMenu": {
"duplicateTab": "Duplicate Tab",