import { describe, expect, it } from 'vitest';
|
|
import { getColumnActionWidth, resolveColumnActionGroups } from '../helpers/tableActions';
|
|
describe('resolveColumnActionGroups', () => {
|
it('keeps custom row buttons inline instead of moving them into more actions', () => {
|
const columnButtons = [{ label: '编辑', value: 'edit' }];
|
const customColumnButtons = [
|
{ event: { position: 1 }, label: '打印', value: 'print' },
|
{ event: { position: 3 }, label: '发起流程', value: 'launchFlow' },
|
];
|
|
const groups = resolveColumnActionGroups(columnButtons, customColumnButtons);
|
|
expect(groups.inlineButtons).toEqual([...columnButtons, ...customColumnButtons]);
|
expect(groups.moreButtons).toEqual([]);
|
});
|
|
it('calculates action column width from all inline buttons', () => {
|
expect(getColumnActionWidth(1, 2)).toBe(170);
|
});
|
});
|