fix: suppress stale grid empty overlay (V13-FE-011)
This commit is contained in:
@@ -55,6 +55,7 @@ function onRowClicked(event: RowClickedEvent): void {
|
||||
:column-defs="columnDefs"
|
||||
:row-selection="rowSelectionOptions"
|
||||
:loading="loading"
|
||||
:suppress-no-rows-overlay="rows.length > 0"
|
||||
@row-clicked="onRowClicked"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import AgGridAdapter from '../AgGridAdapter.vue'
|
||||
|
||||
const columns = [{ field: 'id', header: 'ID' }]
|
||||
|
||||
describe('AgGridAdapter', () => {
|
||||
it('suppresses the stale empty overlay when rows are present', () => {
|
||||
const wrapper = mount(AgGridAdapter, {
|
||||
props: { rows: [{ id: 'T01' }], columns },
|
||||
global: {
|
||||
stubs: {
|
||||
AgGridVue: {
|
||||
props: ['suppressNoRowsOverlay'],
|
||||
template: '<div data-test="grid" :data-suppress-no-rows-overlay="String(suppressNoRowsOverlay)" />'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
expect(wrapper.get('[data-test="grid"]').attributes('data-suppress-no-rows-overlay')).toBe('true')
|
||||
})
|
||||
|
||||
it('keeps the empty overlay available when there are no rows', () => {
|
||||
const wrapper = mount(AgGridAdapter, {
|
||||
props: { rows: [], columns },
|
||||
global: {
|
||||
stubs: {
|
||||
AgGridVue: {
|
||||
props: ['suppressNoRowsOverlay'],
|
||||
template: '<div data-test="grid" :data-suppress-no-rows-overlay="String(suppressNoRowsOverlay)" />'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
expect(wrapper.get('[data-test="grid"]').attributes('data-suppress-no-rows-overlay')).toBe('false')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user