19 lines
596 B
TypeScript
19 lines
596 B
TypeScript
import { fireEvent } from '@testing-library/react';
|
|
|
|
import type { DataDateString } from 'shared/types/date';
|
|
|
|
import { screen } from './utils';
|
|
|
|
export const pickCellByDataDate = (dataDate: DataDateString) => {
|
|
const cellElem = screen.getByDataDate(dataDate);
|
|
fireEvent.click(cellElem);
|
|
};
|
|
|
|
export const dragAndDropCellByDataDate = (dragDataDate: DataDateString, dropDataDate: DataDateString) => {
|
|
const oldLastDateElem = screen.getByDataDate(dragDataDate);
|
|
const dropTarget = screen.getByDataDate(dropDataDate);
|
|
|
|
fireEvent.dragStart(oldLastDateElem);
|
|
fireEvent.drop(dropTarget);
|
|
};
|