mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-27 18:24:11 +00:00
fix: address review feedback - fixed height, remove redundant code, improve tests
Amp-Thread-ID: https://ampcode.com/threads/T-019c176b-ea24-74be-8443-446ec9522c03
This commit is contained in:
@@ -71,11 +71,10 @@ describe('VirtualGrid', () => {
|
||||
|
||||
await nextTick()
|
||||
|
||||
if (receivedIndices.length > 0) {
|
||||
expect(receivedIndices[0]).toBe(0)
|
||||
for (let i = 1; i < receivedIndices.length; i++) {
|
||||
expect(receivedIndices[i]).toBe(receivedIndices[i - 1] + 1)
|
||||
}
|
||||
expect(receivedIndices.length).toBeGreaterThan(0)
|
||||
expect(receivedIndices[0]).toBe(0)
|
||||
for (let i = 1; i < receivedIndices.length; i++) {
|
||||
expect(receivedIndices[i]).toBe(receivedIndices[i - 1] + 1)
|
||||
}
|
||||
|
||||
wrapper.unmount()
|
||||
@@ -97,6 +96,9 @@ describe('VirtualGrid', () => {
|
||||
const gridElement = wrapper.find('[style*="grid"]')
|
||||
expect(gridElement.exists()).toBe(true)
|
||||
|
||||
const style = gridElement.attributes('style') ?? ''
|
||||
expect(style).toContain('repeat(2')
|
||||
|
||||
wrapper.unmount()
|
||||
})
|
||||
|
||||
|
||||
@@ -57,9 +57,7 @@ const emit = defineEmits<{
|
||||
'approach-end': []
|
||||
}>()
|
||||
|
||||
defineSlots<{
|
||||
item: (props: { item: T & { key: string }; index: number }) => unknown
|
||||
}>()
|
||||
|
||||
|
||||
const itemHeight = ref(defaultItemHeight)
|
||||
const itemWidth = ref(defaultItemWidth)
|
||||
|
||||
@@ -64,7 +64,6 @@ const layoutConfig = computed<LayoutConfig>(
|
||||
|
||||
const gridStyle = computed<CSSProperties>(() => ({
|
||||
display: 'grid',
|
||||
gridTemplateColumns: `repeat(${layoutConfig.value.maxColumns}, 1fr)`,
|
||||
gap: layoutConfig.value.gap,
|
||||
padding: '1rem',
|
||||
width: '100%'
|
||||
@@ -81,7 +80,7 @@ const virtualItems = computed<VirtualDropdownItem[]>(() =>
|
||||
|
||||
<template>
|
||||
<div
|
||||
class="flex max-h-[640px] w-103 flex-col rounded-lg bg-component-node-background pt-4 outline outline-offset-[-1px] outline-node-component-border"
|
||||
class="flex h-[640px] w-103 flex-col rounded-lg bg-component-node-background pt-4 outline outline-offset-[-1px] outline-node-component-border"
|
||||
>
|
||||
<!-- Filter -->
|
||||
<FormDropdownMenuFilter
|
||||
|
||||
Reference in New Issue
Block a user