lint: fix merge branch lint error

This commit is contained in:
栗嘉男 2024-01-28 13:31:58 +08:00
parent 90b4d05a29
commit 80db8eaf3b
2 changed files with 11 additions and 15 deletions

View File

@ -7,7 +7,10 @@ export function getTargetRect(target: BindElement): DOMRect {
}
export function getFixedTop(placeholderRect: DOMRect, targetRect: DOMRect, offsetTop?: number) {
if (offsetTop !== undefined && Math.round(targetRect.top) > Math.round(placeholderRect.top) - offsetTop) {
if (
offsetTop !== undefined &&
Math.round(targetRect.top) > Math.round(placeholderRect.top) - offsetTop
) {
return offsetTop + targetRect.top;
}
return undefined;
@ -18,7 +21,10 @@ export function getFixedBottom(
targetRect: DOMRect,
offsetBottom?: number,
) {
if (offsetBottom !== undefined && Math.round(targetRect.bottom) < Math.round(placeholderRect.bottom) + offsetBottom) {
if (
offsetBottom !== undefined &&
Math.round(targetRect.bottom) < Math.round(placeholderRect.bottom) + offsetBottom
) {
const targetBottomOffset = window.innerHeight - targetRect.bottom;
return offsetBottom + targetBottomOffset;
}

View File

@ -579,7 +579,7 @@ describe('Table.filter', () => {
expect(container.querySelectorAll('tbody tr').length).toBe(4);
});
it('can filter children by defaultFilteredValue', async () => {
it('can filter children by defaultFilteredValue', () => {
const { container } = render(
createTable({
columns: [
@ -674,7 +674,7 @@ describe('Table.filter', () => {
await waitFor(() => expect(handleChange).not.toHaveBeenCalled());
});
it('three levels menu', async () => {
it('three levels menu', () => {
const onChange = jest.fn();
const filters = [
{ text: 'Upper', value: 'Upper' },
@ -697,17 +697,7 @@ describe('Table.filter', () => {
],
},
];
const { container } = render(
createTable({
columns: [
{
...column,
filters,
},
],
onChange,
}),
);
const { container } = render(createTable({ columns: [{ ...column, filters }], onChange }));
expect(renderedNames(container)).toEqual(['Jack', 'Lucy', 'Tom', 'Jerry']);