fix: Invalid options for Select and MultiSelect when both legacy and new options(i.e. with and without id are present) (#16509)
* Fix invalid select options * Add test for multiselect filling and fix bug with csv reporting * Fix options getting duplicated * Add getQueryBuilderConfig tests
This commit is contained in:
1 parent
6e54c459a4
commit
ef0ba48f49
14 files changed
+439
-134
No files matched your search
@@ -319,10 +319,14 @@ export const createUsersFixture = (
|
||||
}
|
||||
|
||||
if (scenario.seedRoutingForms) {
|
||||
const option2Uuid = "d1302635-9f12-17b1-9153-c3a854649182";
|
||||
const option1Uuid = "d1292635-9f12-17b1-9153-c3a854649182";
|
||||
const multiSelectOption2Uuid = "d1302635-9f12-17b1-9153-c3a854649182";
|
||||
const multiSelectOption1Uuid = "d1292635-9f12-17b1-9153-c3a854649182";
|
||||
const selectOption1Uuid = "d0292635-9f12-17b1-9153-c3a854649182";
|
||||
const selectOption2Uuid = "d0302635-9f12-17b1-9153-c3a854649182";
|
||||
const multiSelectLegacyFieldUuid = "d4292635-9f12-17b1-9153-c3a854649182";
|
||||
const multiSelectFieldUuid = "d9892635-9f12-17b1-9153-c3a854649182";
|
||||
const selectFieldUuid = "d1302635-9f12-17b1-9153-c3a854649182";
|
||||
const legacySelectFieldUuid = "f0292635-9f12-17b1-9153-c3a854649182";
|
||||
await prisma.app_RoutingForms_Form.create({
|
||||
data: {
|
||||
routes: [
|
||||
@@ -417,7 +421,7 @@ export const createUsersFixture = (
|
||||
type: "rule",
|
||||
properties: {
|
||||
field: multiSelectFieldUuid,
|
||||
value: [[option2Uuid]],
|
||||
value: [[multiSelectOption2Uuid]],
|
||||
operator: "multiselect_equals",
|
||||
valueSrc: ["value"],
|
||||
valueType: ["multiselect"],
|
||||
@@ -455,11 +459,36 @@ export const createUsersFixture = (
|
||||
identifier: "multi-new-format",
|
||||
options: [
|
||||
{
|
||||
id: option1Uuid,
|
||||
id: multiSelectOption1Uuid,
|
||||
label: "Option-1",
|
||||
},
|
||||
{
|
||||
id: option2Uuid,
|
||||
id: multiSelectOption2Uuid,
|
||||
label: "Option-2",
|
||||
},
|
||||
],
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
id: legacySelectFieldUuid,
|
||||
type: "select",
|
||||
label: "Legacy Select",
|
||||
identifier: "test-select",
|
||||
selectText: "Option-1\nOption-2",
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
id: selectFieldUuid,
|
||||
type: "select",
|
||||
label: "Select",
|
||||
identifier: "test-select-new-format",
|
||||
options: [
|
||||
{
|
||||
id: selectOption1Uuid,
|
||||
label: "Option-1",
|
||||
},
|
||||
{
|
||||
id: selectOption2Uuid,
|
||||
label: "Option-2",
|
||||
},
|
||||
],
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import type { Page } from "@playwright/test";
|
||||
|
||||
export const selectInteractions = {
|
||||
async chooseOption({
|
||||
page,
|
||||
selector,
|
||||
optionText,
|
||||
}: {
|
||||
page: Page;
|
||||
selector: string;
|
||||
optionText: string;
|
||||
}): Promise<void> {
|
||||
// Open dropdown
|
||||
await page.locator(selector).click();
|
||||
const selectParentWithOptions = page.locator(`:has(> ${selector})`);
|
||||
// Select option
|
||||
await selectParentWithOptions.getByText(optionText, { exact: true }).click();
|
||||
},
|
||||
};
|
||||
Reference in new issue
Block a user