mirror of
https://github.com/qlik-oss/nebula.js.git
synced 2025-12-25 01:04:14 -05:00
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:
@@ -7,8 +7,10 @@ export default function getListboxActionProps({
|
||||
extraItems,
|
||||
selections,
|
||||
keyboard,
|
||||
autoConfirm,
|
||||
}) {
|
||||
return {
|
||||
autoConfirm,
|
||||
isDetached,
|
||||
show: showToolbar && !isDetached,
|
||||
popover: {
|
||||
|
||||
@@ -254,6 +254,7 @@ window.getFuncs = function getFuncs() {
|
||||
qInfo: {
|
||||
qId: 'qId',
|
||||
},
|
||||
autoConfirm: options?.autoConfirm,
|
||||
visualization: 'listbox',
|
||||
qListObject: {
|
||||
qDimensionInfo: {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 |
Reference in New Issue
Block a user