add index to tests

This commit is contained in:
bigmistqke
2022-11-14 17:42:50 +01:00
parent 30def3511e
commit f43f433f51
2 changed files with 4 additions and 3 deletions

View File

@@ -2,8 +2,8 @@ import React from 'react';
import { RowHeaderComponent } from '../../../../src/admin/components/forms/RowHeader/types';
const ArrayRowHeader: RowHeaderComponent = (props) => {
const { value } = props;
return <React.Fragment>{value.title || 'enter title'}</React.Fragment>;
const { value, index } = props;
return <React.Fragment>{value.title || `array_${index}`}</React.Fragment>;
};
export default ArrayRowHeader;

View File

@@ -1,3 +1,4 @@
import { RowHeaderFunction } from '../../../../src/admin/components/forms/RowHeader/types';
import type { CollectionConfig } from '../../../../src/collections/config/types';
import HeaderComponent from './HeaderComponent';
@@ -94,7 +95,7 @@ const ArrayFields: CollectionConfig = {
],
admin: {
components: {
RowHeader: ({ value }) => value.title || 'untitled',
RowHeader: ({ value, index }) => value.title || `item ${index}`,
},
},
},