mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-09-03 20:52:57 -05:00
Automatically apply virtualization in the DataGridView of SchemaView if the schema contains only one collection. #7607
This commit is contained in:
@@ -70,8 +70,8 @@ describe('SchemaView', ()=>{
|
||||
await user.type(ctrl.container.querySelector('[name="field2"]'), '2');
|
||||
await user.type(ctrl.container.querySelector('[name="field5"]'), 'val5');
|
||||
/* Add a row */
|
||||
await user.click(ctrl.container.querySelector('[data-test="add-row"]'));
|
||||
await user.click(ctrl.container.querySelector('[data-test="add-row"]'));
|
||||
await user.click(ctrl.container.querySelector('button[data-test="add-row"]'));
|
||||
await user.click(ctrl.container.querySelector('button[data-test="add-row"]'));
|
||||
await user.type(ctrl.container.querySelectorAll('[name="field5"]')[0], 'rval51');
|
||||
await user.type(ctrl.container.querySelectorAll('[name="field5"]')[1], 'rval52');
|
||||
};
|
||||
|
||||
@@ -35,7 +35,7 @@ class TestSubSchema extends BaseUISchema {
|
||||
{
|
||||
id: 'field5', label: 'Field5', type: 'multiline', group: null,
|
||||
cell: 'text', mode: ['properties', 'edit', 'create'], disabled: false,
|
||||
noEmpty: true, minWidth: '50%',
|
||||
noEmpty: true, minWidth: 50,
|
||||
},
|
||||
{
|
||||
id: 'fieldskip', label: 'FieldSkip', type: 'text', group: null,
|
||||
|
||||
@@ -65,5 +65,33 @@ document.createRange = () => {
|
||||
return range;
|
||||
};
|
||||
|
||||
// for virtual tables, height should exist.
|
||||
Element.prototype.getBoundingClientRect = jest.fn(function () {
|
||||
if (this.classList?.contains('pgrt')) {
|
||||
return {
|
||||
width: 400,
|
||||
height: 400,
|
||||
top: 0,
|
||||
left: 0,
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
x: 0,
|
||||
y: 0,
|
||||
toJSON: () => {},
|
||||
};
|
||||
}
|
||||
return {
|
||||
width: 0,
|
||||
height: 0,
|
||||
top: 0,
|
||||
left: 0,
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
x: 0,
|
||||
y: 0,
|
||||
toJSON: () => {},
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
jest.setTimeout(18000); // 1 second
|
||||
|
||||
Reference in New Issue
Block a user