diff --git a/packages/core/client/src/modules/actions/__e2e__/link/basic.test.ts b/packages/core/client/src/modules/actions/__e2e__/link/basic.test.ts index 048b30f3de..48828569fa 100644 --- a/packages/core/client/src/modules/actions/__e2e__/link/basic.test.ts +++ b/packages/core/client/src/modules/actions/__e2e__/link/basic.test.ts @@ -152,6 +152,6 @@ test.describe('Link', () => { // After clicking the Link button, the browser URL will change, and the value of the input box using variables will be updated await page.getByLabel('action-Action.Link-Link-').click(); await page.waitForTimeout(100); - await expect(page.getByLabel('block-item-CollectionField-')).toHaveText(`Roles:adminmemberroot`); + await expect(page.getByLabel('block-item-CollectionField-')).toContainText(`Roles:adminmemberroot`); }); }); diff --git a/packages/core/client/src/modules/variable/__e2e__/basic.test.ts b/packages/core/client/src/modules/variable/__e2e__/basic.test.ts index 901f4fbf2b..55d755cb8d 100644 --- a/packages/core/client/src/modules/variable/__e2e__/basic.test.ts +++ b/packages/core/client/src/modules/variable/__e2e__/basic.test.ts @@ -61,7 +61,7 @@ test.describe('variables', () => { await page.getByRole('menuitemcheckbox', { name: 'Table selected records right' }).click(); await page.getByRole('menuitemcheckbox', { name: 'm2m' }).click(); await page.getByRole('button', { name: 'OK', exact: true }).click(); - await expect(page.getByLabel('block-item-CollectionField-')).toHaveText( + await expect(page.getByLabel('block-item-CollectionField-')).toContainText( `m2m:${record.m2m.map((r) => r.id).join('')}`, ); diff --git a/packages/core/client/src/schema-component/antd/select/Select.tsx b/packages/core/client/src/schema-component/antd/select/Select.tsx index 81f954c42d..79292ce358 100644 --- a/packages/core/client/src/schema-component/antd/select/Select.tsx +++ b/packages/core/client/src/schema-component/antd/select/Select.tsx @@ -109,6 +109,7 @@ const ObjectSelect = (props: SelectProps) => { ); }} + maxTagCount="responsive" {...others} /> ); @@ -176,6 +177,7 @@ const InternalSelect = connect( props.onChange?.(changed === undefined ? null : changed); }} mode={mode} + maxTagCount="responsive" /> ); }, diff --git a/packages/core/client/src/schema-component/antd/select/__tests__/select.test.tsx b/packages/core/client/src/schema-component/antd/select/__tests__/select.test.tsx index 24961c4174..06f78377c4 100644 --- a/packages/core/client/src/schema-component/antd/select/__tests__/select.test.tsx +++ b/packages/core/client/src/schema-component/antd/select/__tests__/select.test.tsx @@ -36,8 +36,8 @@ describe('Select', () => { await userEvent.click(screen.getByText('福州')); await userEvent.click(selector); fireEvent.click(screen.getByText('浙江')); - expect(screen.getAllByText('福州')).toHaveLength(3); - expect(screen.getAllByText('浙江')).toHaveLength(3); + expect(screen.getAllByText('福州')).toHaveLength(2); + expect(screen.getAllByText('浙江')).toHaveLength(2); }); it('select one & objectValue: true', async () => { diff --git a/packages/plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/manyToMany/schemaSettings1.test.ts b/packages/plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/manyToMany/schemaSettings1.test.ts index ea0bf672fb..4dde69d19e 100644 --- a/packages/plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/manyToMany/schemaSettings1.test.ts +++ b/packages/plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/manyToMany/schemaSettings1.test.ts @@ -87,7 +87,7 @@ test.describe('form item & create form', () => { expectConstantValue: async () => { await expect( page.getByLabel('block-item-CollectionField-general-form-general.manyToMany-manyToMany'), - ).toHaveText(`manyToMany:${recordsOfUser.map((record) => record.id).join('')}`); + ).toContainText(`manyToMany:${recordsOfUser.map((record) => record.id).join('')}`); }, }); }); @@ -137,7 +137,7 @@ test.describe('form item & create form', () => { expectEasyReading: async () => { await expect( page.getByLabel('block-item-CollectionField-general-form-general.manyToMany-manyToMany'), - ).toHaveText(`manyToMany:${records.map((record) => record.id).join(',')}`); + ).toContainText(`manyToMany:${records.map((record) => record.id).join(',')}`); }, }); }); diff --git a/packages/plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/manyToMany/schemaSettings2.test.ts b/packages/plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/manyToMany/schemaSettings2.test.ts index 8e775e065c..0ee9ecbc03 100644 --- a/packages/plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/manyToMany/schemaSettings2.test.ts +++ b/packages/plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/manyToMany/schemaSettings2.test.ts @@ -84,7 +84,7 @@ test.describe('form item & edit form', () => { page .getByLabel('block-item-CollectionField-general-form-general.manyToMany-manyToMany') .getByTestId('select-object-multiple'), - ).toHaveText(`${record.manyToMany.map((item) => item.id).join('')}`); + ).toContainText(`${record.manyToMany.map((item) => item.id).join('')}`); }, expectReadonly: async () => { await expect( diff --git a/packages/plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/mutipleSelect/schemaSettings.test.ts b/packages/plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/mutipleSelect/schemaSettings.test.ts index 69d8c003ba..5d5a1926f4 100644 --- a/packages/plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/mutipleSelect/schemaSettings.test.ts +++ b/packages/plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/mutipleSelect/schemaSettings.test.ts @@ -77,7 +77,7 @@ test.describe('form item & create form', () => { expectConstantValue: async () => { await expect( page.getByLabel('block-item-CollectionField-general-form-general.multipleSelect-multipleSelect'), - ).toHaveText('multipleSelect:Option1Option2Option3'); + ).toContainText('multipleSelect:Option1Option2Option3'); }, }); }); @@ -191,7 +191,7 @@ test.describe('form item & edit form', () => { page .getByLabel('block-item-CollectionField-general-form-general.multipleSelect-multipleSelect') .getByTestId('select-multiple'), - ).toHaveText(`${record.multipleSelect.join('')}`, { ignoreCase: true }); + ).toContainText(`${record.multipleSelect.join('')}`, { ignoreCase: true }); }, expectReadonly: async () => { await expect( diff --git a/packages/plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/oneToMany/schemaSettings2.test.ts b/packages/plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/oneToMany/schemaSettings2.test.ts index 619edfdc64..b00b7e4fa9 100644 --- a/packages/plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/oneToMany/schemaSettings2.test.ts +++ b/packages/plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/oneToMany/schemaSettings2.test.ts @@ -84,7 +84,7 @@ test.describe('form item & edit form', () => { page .getByLabel('block-item-CollectionField-general-form-general.oneToMany-oneToMany') .getByTestId('select-object-multiple'), - ).toHaveText(`${record.oneToMany.map((item) => item.id).join('')}`); + ).toContainText(`${record.oneToMany.map((item) => item.id).join('')}`); }, expectReadonly: async () => { await expect(