fix: forward job list attrs to scroll container

This commit is contained in:
Benjamin Lu
2026-03-26 22:11:47 -07:00
parent ef453b31fd
commit daa8782f88
2 changed files with 32 additions and 0 deletions

View File

@@ -176,6 +176,33 @@ describe('JobAssetsList', () => {
expect(wrapper.find('[data-job-id="job-2"]').exists()).toBe(true)
})
it('forwards parent attrs to the scroll container', () => {
const wrapper = mount(JobAssetsList, {
attrs: {
class: 'min-h-0 flex-1'
},
props: {
displayedJobGroups: [
{
key: 'today',
label: 'Today',
items: [buildJob({ id: 'job-1' })]
}
]
},
global: {
stubs: {
teleport: true,
JobDetailsPopover: JobDetailsPopoverStub
}
}
})
expect(wrapper.get('[data-testid="job-assets-list"]').classes()).toEqual(
expect.arrayContaining(['min-h-0', 'flex-1', 'h-full', 'overflow-y-auto'])
)
})
it('emits viewItem on preview-click for completed jobs with preview', async () => {
const job = buildJob()
const wrapper = mountJobAssetsList([job])

View File

@@ -1,5 +1,6 @@
<template>
<div
v-bind="$attrs"
:ref="containerProps.ref"
:style="containerProps.style"
data-testid="job-assets-list"
@@ -124,6 +125,10 @@ import { cn } from '@/utils/tailwindUtil'
import { iconForJobState } from '@/utils/queueDisplay'
import { isActiveJobState } from '@/utils/queueUtil'
defineOptions({
inheritAttrs: false
})
const HEADER_ROW_HEIGHT = 20
const GROUP_ROW_GAP = 16
const JOB_ROW_HEIGHT = 48