fix(listbox): add removed autoConfirm option (#1496)

* test: add rendering test for auto confirm

* fix: add back auto confirm

* test: move autoconfirm

* test: upload new snapshot
This commit is contained in:
Johan Lahti
2024-02-26 09:52:17 +01:00
committed by GitHub
parent 5984fe3e07
commit c2ffdc8479
5 changed files with 23 additions and 1 deletions

View File

@@ -7,8 +7,10 @@ export default function getListboxActionProps({
extraItems,
selections,
keyboard,
autoConfirm,
}) {
return {
autoConfirm,
isDetached,
show: showToolbar && !isDetached,
popover: {

View File

@@ -254,6 +254,7 @@ window.getFuncs = function getFuncs() {
qInfo: {
qId: 'qId',
},
autoConfirm: options?.autoConfirm,
visualization: 'listbox',
qListObject: {
qDimensionInfo: {

View File

@@ -21,7 +21,6 @@
getAppLayout: async () => ({ qTitle: '', qLocaleInfo: {} }),
};
return {
obj,
app,
};
}
@@ -64,6 +63,9 @@
case 'standard':
sc = {};
break;
case 'autoConfirm':
sc = { autoConfirm: true };
break;
case 'checkboxes':
sc = { checkboxes: true };
break;

View File

@@ -66,6 +66,23 @@ test.describe('listbox mashup rendering test', () => {
return expect(image).toMatchSnapshot(FILE_NAME);
});
test('selecting values should not show the selections toolbar when autoConfirm is true', async () => {
const FILE_NAME = 'listbox_select_EH_auto_confirm.png';
await page.goto(`${url}/listbox/listbox.html?scenario=autoConfirm`, { waitUntil: 'networkidle' });
const selector = await page.waitForSelector(listboxSelector, { visible: true });
const selectNumbers = [4, 7];
const action = async (nbr) => {
const rowSelector = `${listboxSelector} [data-n="${nbr}"]`;
await page.click(rowSelector);
};
await execSequence(selectNumbers, action);
const image = await selector.screenshot({ caret: 'hide' });
return expect(image).toMatchSnapshot(FILE_NAME);
});
test('listbox search', async () => {
const FILE_NAME = 'listbox_search_B.png';
const searchSelector = '.search input';

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB