test(e2e): add a test for check table row (#2757)

This commit is contained in:
被雨水过滤的空气-Rain 2023-10-07 17:54:11 +08:00 committed by GitHub
parent 26a3f2f589
commit b4d2102e75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 361 additions and 808 deletions

View File

@ -0,0 +1,359 @@
import { expect, test } from '@nocobase/test/client';
const config = {
pageSchema: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-component': 'Page',
properties: {
nrwnyusnbrd: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-component': 'Grid',
'x-initializer': 'BlockInitializers',
properties: {
w85tu6tnlfp: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-component': 'Grid.Row',
properties: {
q9vljapijwj: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-component': 'Grid.Col',
properties: {
zia3dyel3jr: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-decorator': 'TableBlockProvider',
'x-acl-action': 't_fhdhd0nk7b9:list',
'x-decorator-props': {
collection: 't_fhdhd0nk7b9',
resource: 't_fhdhd0nk7b9',
action: 'list',
params: {
pageSize: 20,
},
rowKey: 'id',
showIndex: true,
dragSort: false,
disableTemplate: false,
},
'x-designer': 'TableBlockDesigner',
'x-component': 'CardItem',
'x-filter-targets': [],
properties: {
actions: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-initializer': 'TableActionInitializers',
'x-component': 'ActionBar',
'x-component-props': {
style: {
marginBottom: 'var(--nb-spacing)',
},
},
properties: {
'5210td4a1ms': {
_isJSONSchemaObject: true,
version: '2.0',
title: '{{ t("Delete") }}',
'x-action': 'destroy',
'x-component': 'Action',
'x-designer': 'Action.Designer',
'x-decorator': 'ACLActionProvider',
'x-acl-action-props': {
skipScopeCheck: true,
},
'x-component-props': {
icon: 'DeleteOutlined',
confirm: {
title: "{{t('Delete record')}}",
content: "{{t('Are you sure you want to delete it?')}}",
},
useProps: '{{ useBulkDestroyActionProps }}',
},
'x-acl-action': 't_fhdhd0nk7b9:destroy',
'x-align': 'right',
type: 'void',
'x-uid': 'aud7zy2m18z',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'j10gefyy50y',
'x-async': false,
'x-index': 1,
},
k88f9zdl4k1: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'array',
'x-initializer': 'TableColumnInitializers',
'x-component': 'TableV2',
'x-component-props': {
rowKey: 'id',
rowSelection: {
type: 'checkbox',
},
useProps: '{{ useTableBlockProps }}',
},
properties: {
actions: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
title: '{{ t("Actions") }}',
'x-action-column': 'actions',
'x-decorator': 'TableV2.Column.ActionBar',
'x-component': 'TableV2.Column',
'x-designer': 'TableV2.ActionColumnDesigner',
'x-initializer': 'TableActionColumnInitializers',
properties: {
actions: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-decorator': 'DndContext',
'x-component': 'Space',
'x-component-props': {
split: '|',
},
'x-uid': 'lky44f6h6kh',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'fvkqaxe6bo1',
'x-async': false,
'x-index': 1,
},
wwn0ajwixxl: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-decorator': 'TableV2.Column.Decorator',
'x-designer': 'TableV2.Column.Designer',
'x-component': 'TableV2.Column',
properties: {
f_vbrlno0zej9: {
_isJSONSchemaObject: true,
version: '2.0',
'x-collection-field': 't_fhdhd0nk7b9.f_vbrlno0zej9',
'x-component': 'CollectionField',
'x-component-props': {
ellipsis: true,
},
'x-read-pretty': true,
'x-decorator': null,
'x-decorator-props': {
labelStyle: {
display: 'none',
},
},
'x-uid': 'emphc9g52u7',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'q7h24jnc070',
'x-async': false,
'x-index': 2,
},
},
'x-uid': 'a9qdzmt4vai',
'x-async': false,
'x-index': 2,
},
},
'x-uid': '98ta7h4ba1f',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'mo6eowotbqd',
'x-async': false,
'x-index': 1,
},
},
'x-uid': '2nmkby45kce',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'zyukds9t2ln',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'd0j1mfitnmr',
'x-async': true,
'x-index': 1,
},
collections: [
{
key: '2msxqih7erw',
name: 't_fhdhd0nk7b9',
title: 'test',
inherit: false,
hidden: false,
description: null,
fields: [
{
key: 'gdzq595upa9',
name: 'id',
type: 'bigInt',
interface: 'id',
description: null,
collectionName: 't_fhdhd0nk7b9',
parentKey: null,
reverseKey: null,
autoIncrement: true,
primaryKey: true,
allowNull: false,
uiSchema: {
type: 'number',
title: '{{t("ID")}}',
'x-component': 'InputNumber',
'x-read-pretty': true,
},
},
{
key: '29a0p3so5dm',
name: 'createdAt',
type: 'date',
interface: 'createdAt',
description: null,
collectionName: 't_fhdhd0nk7b9',
parentKey: null,
reverseKey: null,
field: 'createdAt',
uiSchema: {
type: 'datetime',
title: '{{t("Created at")}}',
'x-component': 'DatePicker',
'x-component-props': {},
'x-read-pretty': true,
},
},
{
key: 'd3v2o9bozd8',
name: 'createdBy',
type: 'belongsTo',
interface: 'createdBy',
description: null,
collectionName: 't_fhdhd0nk7b9',
parentKey: null,
reverseKey: null,
target: 'users',
foreignKey: 'createdById',
uiSchema: {
type: 'object',
title: '{{t("Created by")}}',
'x-component': 'AssociationField',
'x-component-props': {
fieldNames: {
value: 'id',
label: 'nickname',
},
},
'x-read-pretty': true,
},
targetKey: 'id',
},
{
key: '9b2y04n3eiw',
name: 'updatedAt',
type: 'date',
interface: 'updatedAt',
description: null,
collectionName: 't_fhdhd0nk7b9',
parentKey: null,
reverseKey: null,
field: 'updatedAt',
uiSchema: {
type: 'string',
title: '{{t("Last updated at")}}',
'x-component': 'DatePicker',
'x-component-props': {},
'x-read-pretty': true,
},
},
{
key: 'o8jej996mnu',
name: 'updatedBy',
type: 'belongsTo',
interface: 'updatedBy',
description: null,
collectionName: 't_fhdhd0nk7b9',
parentKey: null,
reverseKey: null,
target: 'users',
foreignKey: 'updatedById',
uiSchema: {
type: 'object',
title: '{{t("Last updated by")}}',
'x-component': 'AssociationField',
'x-component-props': {
fieldNames: {
value: 'id',
label: 'nickname',
},
},
'x-read-pretty': true,
},
targetKey: 'id',
},
{
key: '37cbs72sgdn',
name: 'f_vbrlno0zej9',
type: 'string',
interface: 'input',
description: null,
collectionName: 't_fhdhd0nk7b9',
parentKey: null,
reverseKey: null,
uiSchema: {
type: 'string',
'x-component': 'Input',
title: 'name',
},
},
],
category: [],
logging: true,
autoGenId: true,
createdBy: true,
updatedBy: true,
createdAt: true,
updatedAt: true,
sortable: true,
template: 'general',
view: false,
},
],
};
test('check table row', async ({ page, mockPage }) => {
await mockPage(config).goto();
await expect(page.getByText('cur vulpes suppellex')).toBeVisible();
await page.getByTestId('table-index-1').hover();
await page.getByTestId('table-index-1').getByLabel('').click();
await page.getByTestId('destroy-action').click();
// 显示确认弹窗
await expect(page.getByText('Are you sure you want to delete it?')).toBeVisible();
// 点击确认
await page.getByText('ok').click();
// 确认内容已被删除
await expect(page.getByText('cur vulpes suppellex')).not.toBeVisible();
});

View File

@ -1,803 +0,0 @@
import { test } from '@nocobase/test/client';
const t2072Config = {
collections: [
{
key: 'etlrv6xojl4',
name: 't_cyjvg3xxak7',
title: '人工>组织[普通表]',
inherit: false,
hidden: false,
description: null,
fields: [
{
key: 'e4jfv35cotm',
name: 'id',
type: 'bigInt',
interface: 'id',
description: null,
collectionName: 't_cyjvg3xxak7',
parentKey: null,
reverseKey: null,
autoIncrement: true,
primaryKey: true,
allowNull: false,
uiSchema: {
type: 'number',
title: '{{t("ID")}}',
'x-component': 'InputNumber',
'x-read-pretty': true,
},
},
{
key: '778zti7timg',
name: 'f_jnf1x0qxsnz',
type: 'bigInt',
interface: 'integer',
description: null,
collectionName: 't_cyjvg3xxak7',
parentKey: null,
reverseKey: null,
isForeignKey: true,
uiSchema: {
type: 'number',
title: 'f_jnf1x0qxsnz',
'x-component': 'InputNumber',
'x-read-pretty': true,
},
},
{
key: '2nuvtsxlzvh',
name: 'f_zx8j9897cv5',
type: 'bigInt',
interface: 'integer',
description: null,
collectionName: 't_cyjvg3xxak7',
parentKey: null,
reverseKey: null,
isForeignKey: true,
uiSchema: {
type: 'number',
title: 'f_zx8j9897cv5',
'x-component': 'InputNumber',
'x-read-pretty': true,
},
},
{
key: 'q491jgqygpg',
name: 'createdAt',
type: 'date',
interface: 'createdAt',
description: null,
collectionName: 't_cyjvg3xxak7',
parentKey: null,
reverseKey: null,
field: 'createdAt',
uiSchema: {
type: 'datetime',
title: '{{t("Created at")}}',
'x-component': 'DatePicker',
'x-component-props': {},
'x-read-pretty': true,
},
},
{
key: 'q2uungrabre',
name: 'createdBy',
type: 'belongsTo',
interface: 'createdBy',
description: null,
collectionName: 't_cyjvg3xxak7',
parentKey: null,
reverseKey: null,
target: 'users',
foreignKey: 'createdById',
uiSchema: {
type: 'object',
title: '{{t("Created by")}}',
'x-component': 'AssociationField',
'x-component-props': {
fieldNames: {
value: 'id',
label: 'nickname',
},
},
'x-read-pretty': true,
},
targetKey: 'id',
},
{
key: 'cizz53lon1q',
name: 'updatedAt',
type: 'date',
interface: 'updatedAt',
description: null,
collectionName: 't_cyjvg3xxak7',
parentKey: null,
reverseKey: null,
field: 'updatedAt',
uiSchema: {
type: 'string',
title: '{{t("Last updated at")}}',
'x-component': 'DatePicker',
'x-component-props': {},
'x-read-pretty': true,
},
},
{
key: '9dd8bohloh2',
name: 'updatedBy',
type: 'belongsTo',
interface: 'updatedBy',
description: null,
collectionName: 't_cyjvg3xxak7',
parentKey: null,
reverseKey: null,
target: 'users',
foreignKey: 'updatedById',
uiSchema: {
type: 'object',
title: '{{t("Last updated by")}}',
'x-component': 'AssociationField',
'x-component-props': {
fieldNames: {
value: 'id',
label: 'nickname',
},
},
'x-read-pretty': true,
},
targetKey: 'id',
},
{
key: 'p7649gl5tic',
name: 'f_wrlootg9xu9',
type: 'hasMany',
interface: 'o2m',
description: null,
collectionName: 't_cyjvg3xxak7',
parentKey: null,
reverseKey: null,
foreignKey: 'f_jnf1x0qxsnz',
onDelete: 'SET NULL',
uiSchema: {
'x-component': 'AssociationField',
'x-component-props': {
multiple: true,
fieldNames: {
label: 'id',
value: 'id',
},
},
title: '部门one to many',
},
target: 't_cyjvg3xxak7',
targetKey: 'id',
sourceKey: 'id',
},
{
key: '6etvnvsplrv',
name: 'f_4xulfnosvlx',
type: 'belongsTo',
interface: 'm2o',
description: null,
collectionName: 't_cyjvg3xxak7',
parentKey: null,
reverseKey: null,
foreignKey: 'f_zx8j9897cv5',
onDelete: 'SET NULL',
uiSchema: {
'x-component': 'AssociationField',
'x-component-props': {
multiple: false,
fieldNames: {
label: 'id',
value: 'id',
},
},
title: '负责人many to one',
},
target: 't_ymx99ljfetl',
targetKey: 'id',
},
],
category: [],
logging: true,
autoGenId: true,
createdBy: true,
updatedBy: true,
createdAt: true,
updatedAt: true,
sortable: true,
template: 'general',
view: false,
},
{
key: 'gmsav2kkbk3',
name: 't_ymx99ljfetl',
title: '人员',
inherit: false,
hidden: false,
description: null,
fields: [
{
key: 'dhonulr1xxc',
name: 'id',
type: 'bigInt',
interface: 'id',
description: null,
collectionName: 't_ymx99ljfetl',
parentKey: null,
reverseKey: null,
autoIncrement: true,
primaryKey: true,
allowNull: false,
uiSchema: {
type: 'number',
title: '{{t("ID")}}',
'x-component': 'InputNumber',
'x-read-pretty': true,
},
},
{
key: 'fh09uvcibsq',
name: 'f_qojsgjsrjie',
type: 'bigInt',
interface: 'integer',
description: null,
collectionName: 't_ymx99ljfetl',
parentKey: null,
reverseKey: null,
isForeignKey: true,
uiSchema: {
type: 'number',
title: 'f_qojsgjsrjie',
'x-component': 'InputNumber',
'x-read-pretty': true,
},
},
{
key: 'xzvwq5g75gi',
name: 'createdAt',
type: 'date',
interface: 'createdAt',
description: null,
collectionName: 't_ymx99ljfetl',
parentKey: null,
reverseKey: null,
field: 'createdAt',
uiSchema: {
type: 'datetime',
title: '{{t("Created at")}}',
'x-component': 'DatePicker',
'x-component-props': {},
'x-read-pretty': true,
},
},
{
key: 'oc580r95evm',
name: 'createdBy',
type: 'belongsTo',
interface: 'createdBy',
description: null,
collectionName: 't_ymx99ljfetl',
parentKey: null,
reverseKey: null,
target: 'users',
foreignKey: 'createdById',
uiSchema: {
type: 'object',
title: '{{t("Created by")}}',
'x-component': 'AssociationField',
'x-component-props': {
fieldNames: {
value: 'id',
label: 'nickname',
},
},
'x-read-pretty': true,
},
targetKey: 'id',
},
{
key: '9zi17bh97yl',
name: 'updatedAt',
type: 'date',
interface: 'updatedAt',
description: null,
collectionName: 't_ymx99ljfetl',
parentKey: null,
reverseKey: null,
field: 'updatedAt',
uiSchema: {
type: 'string',
title: '{{t("Last updated at")}}',
'x-component': 'DatePicker',
'x-component-props': {},
'x-read-pretty': true,
},
},
{
key: '2xbcmman6gz',
name: 'updatedBy',
type: 'belongsTo',
interface: 'updatedBy',
description: null,
collectionName: 't_ymx99ljfetl',
parentKey: null,
reverseKey: null,
target: 'users',
foreignKey: 'updatedById',
uiSchema: {
type: 'object',
title: '{{t("Last updated by")}}',
'x-component': 'AssociationField',
'x-component-props': {
fieldNames: {
value: 'id',
label: 'nickname',
},
},
'x-read-pretty': true,
},
targetKey: 'id',
},
],
category: [],
logging: true,
autoGenId: true,
createdBy: true,
updatedBy: true,
createdAt: true,
updatedAt: true,
sortable: true,
template: 'general',
view: false,
},
],
pageSchema: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-component': 'Page',
properties: {
'3fsvxxy8klh': {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-component': 'Grid',
'x-initializer': 'BlockInitializers',
properties: {
kwm0euv1w2z: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-component': 'Grid.Row',
properties: {
'4wk59ijgdzx': {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-component': 'Grid.Col',
properties: {
vsgx66mbgpm: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-decorator': 'TableBlockProvider',
'x-acl-action': 't_cyjvg3xxak7:list',
'x-decorator-props': {
collection: 't_cyjvg3xxak7',
resource: 't_cyjvg3xxak7',
action: 'list',
params: {
pageSize: 20,
},
rowKey: 'id',
showIndex: true,
dragSort: false,
disableTemplate: false,
},
'x-designer': 'TableBlockDesigner',
'x-component': 'CardItem',
'x-filter-targets': [],
properties: {
actions: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-initializer': 'TableActionInitializers',
'x-component': 'ActionBar',
'x-component-props': {
style: {
marginBottom: 'var(--nb-spacing)',
},
},
properties: {
mb64tcykcw3: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
title: '{{t("Add record")}}',
'x-designer': 'Action.Designer',
'x-component': 'Action',
'x-action': 'customize:create',
'x-component-props': {
openMode: 'drawer',
icon: 'PlusOutlined',
},
'x-align': 'right',
'x-decorator': 'ACLActionProvider',
'x-acl-action': 'create',
'x-acl-action-props': {
skipScopeCheck: true,
},
properties: {
drawer: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
title: '{{t("Add record")}}',
'x-component': 'Action.Container',
'x-component-props': {
className: 'nb-action-popup',
},
properties: {
tabs: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-component': 'Tabs',
'x-component-props': {},
'x-initializer': 'TabPaneInitializersForCreateFormBlock',
properties: {
tab1: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
title: '{{t("Add record")}}',
'x-component': 'Tabs.TabPane',
'x-designer': 'Tabs.Designer',
'x-component-props': {},
properties: {
grid: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-component': 'Grid',
'x-initializer': 'CusomeizeCreateFormBlockInitializers',
properties: {
'4sdqrhx1egh': {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-component': 'Grid.Row',
properties: {
m1gl7ido4xg: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-component': 'Grid.Col',
properties: {
f0srs8s7mq6: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-acl-action-props': {
skipScopeCheck: true,
},
'x-acl-action': 't_cyjvg3xxak7:create',
'x-decorator': 'FormBlockProvider',
'x-decorator-props': {
isCusomeizeCreate: true,
resource: 't_cyjvg3xxak7',
collection: 't_cyjvg3xxak7',
},
'x-designer': 'FormV2.Designer',
'x-component': 'CardItem',
'x-component-props': {},
properties: {
l3kfu43aq17: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-component': 'FormV2',
'x-component-props': {
useProps: '{{ useFormBlockProps }}',
},
properties: {
grid: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-component': 'Grid',
'x-initializer': 'FormItemInitializers',
properties: {
j57m9wdhidh: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-component': 'Grid.Row',
properties: {
'8l5ut3li3my': {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-component': 'Grid.Col',
properties: {
f_wrlootg9xu9: {
'x-uid': 'enypaahwvzs',
_isJSONSchemaObject: true,
version: '2.0',
type: 'string',
'x-designer': 'FormItem.Designer',
'x-component': 'CollectionField',
'x-decorator': 'FormItem',
'x-collection-field':
't_cyjvg3xxak7.f_wrlootg9xu9',
'x-component-props': {
mode: 'SubTable',
},
default: null,
properties: {
svaxqhd7v29: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-component':
'AssociationField.SubTable',
'x-initializer':
'TableColumnInitializers',
'x-initializer-props': {
action: false,
},
'x-index': 1,
properties: {
eevxwy50bcp: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-decorator':
'TableV2.Column.Decorator',
'x-designer':
'TableV2.Column.Designer',
'x-component': 'TableV2.Column',
properties: {
f_4xulfnosvlx: {
'x-uid': 'ho3gwsra9qk',
_isJSONSchemaObject: true,
version: '2.0',
'x-collection-field':
't_cyjvg3xxak7.f_4xulfnosvlx',
'x-component':
'CollectionField',
'x-component-props': {
ellipsis: true,
size: 'small',
},
'x-decorator': 'FormItem',
'x-decorator-props': {
labelStyle: {
display: 'none',
},
},
default:
'{{$context.f_4xulfnosvlx}}',
'x-async': false,
'x-index': 1,
},
},
'x-uid': '6ym1xpsxmyf',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'nmbnils3epp',
'x-async': false,
},
},
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'e69smhckndt',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'puxwfyhomzf',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'rziak1zqrgj',
'x-async': false,
'x-index': 1,
},
actions: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-initializer': 'FormActionInitializers',
'x-component': 'ActionBar',
'x-component-props': {
layout: 'one-column',
style: {
marginTop: 24,
},
},
'x-uid': 'ohkberml3rb',
'x-async': false,
'x-index': 2,
},
},
'x-uid': 't2zwt2anafy',
'x-async': false,
'x-index': 1,
},
},
'x-uid': '9nr7zawsp77',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'sy2eoiiguig',
'x-async': false,
'x-index': 1,
},
},
'x-uid': '3dpkedn8cdb',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'vkzbih8qgqz',
'x-async': false,
'x-index': 1,
},
},
'x-uid': '88pixfaj3wm',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'khgiclrgqhp',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'p5j5303aqdv',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'jcdnkjqfof4',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'wmcdk2bf0rk',
'x-async': false,
'x-index': 1,
},
ooh4p68w3wy: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'array',
'x-initializer': 'TableColumnInitializers',
'x-component': 'TableV2',
'x-component-props': {
rowKey: 'id',
rowSelection: {
type: 'checkbox',
},
useProps: '{{ useTableBlockProps }}',
},
properties: {
actions: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
title: '{{ t("Actions") }}',
'x-action-column': 'actions',
'x-decorator': 'TableV2.Column.ActionBar',
'x-component': 'TableV2.Column',
'x-designer': 'TableV2.ActionColumnDesigner',
'x-initializer': 'TableActionColumnInitializers',
properties: {
actions: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-decorator': 'DndContext',
'x-component': 'Space',
'x-component-props': {
split: '|',
},
'x-uid': 'zf80uv8uhol',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'lrb33ra71kx',
'x-async': false,
'x-index': 1,
},
bi9qnla6pey: {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-decorator': 'TableV2.Column.Decorator',
'x-designer': 'TableV2.Column.Designer',
'x-component': 'TableV2.Column',
properties: {
f_4xulfnosvlx: {
_isJSONSchemaObject: true,
version: '2.0',
'x-collection-field': 't_cyjvg3xxak7.f_4xulfnosvlx',
'x-component': 'CollectionField',
'x-component-props': {
ellipsis: true,
size: 'small',
},
'x-read-pretty': true,
'x-decorator': null,
'x-decorator-props': {
labelStyle: {
display: 'none',
},
},
'x-uid': '9a1xgqcn8g8',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'ipt9o4tqqkw',
'x-async': false,
'x-index': 2,
},
},
'x-uid': 'a89hczfm5nt',
'x-async': false,
'x-index': 2,
},
},
'x-uid': 'sghu92e6os9',
'x-async': false,
'x-index': 1,
},
},
'x-uid': '8bhcc7f8dfb',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'l4nrtmguqpv',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'jfcdfwu92mu',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'cfjrdgvlm68',
'x-async': true,
'x-index': 1,
},
};
test.describe.skip('variables', () => {
test('T-2072', async ({ page, mockPage }) => {
await mockPage(t2072Config).goto();
await page.getByTestId('table-index-1').hover();
await page.getByRole('cell', { name: '1' }).getByLabel('').check();
await page.getByTestId('table-index-2').hover();
await page.getByRole('cell', { name: '2' }).getByLabel('').check();
await page.getByTestId('table-index-3').hover();
await page.getByRole('cell', { name: '3' }).getByLabel('').check();
await page.getByTestId('customize:create-action').click();
});
});

View File

@ -165,11 +165,7 @@ const SortHandle = (props) => {
const TableIndex = (props) => {
const { index } = props;
return (
<div
data-testid={`table-index-${index}`}
className={classNames('nb-table-index')}
style={{ padding: '0 8px 0 16px' }}
>
<div className={classNames('nb-table-index')} style={{ padding: '0 8px 0 16px' }}>
{index}
</div>
);
@ -382,6 +378,7 @@ export const Table: any = observer(
}
return (
<div
data-testid={`table-index-${index}`}
className={classNames(
checked ? 'checked' : null,
css`