fix: improve the display of modal and drawer on mobile (#4237)

This commit is contained in:
Vben
2024-08-26 20:54:20 +08:00
committed by GitHub
parent 577cc85851
commit fd7b3479b4
19 changed files with 99 additions and 34 deletions

View File

@@ -1,6 +1,6 @@
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { getElementVisibleRect } from '../dom'; // 假设函数位于 utils.ts 中
import { getElementVisibleRect } from '../dom';
describe('getElementVisibleRect', () => {
// 设置浏览器视口尺寸的 mock

View File

@@ -7,7 +7,6 @@ import {
toLowerCaseFirstLetter,
} from '../letter';
// 编写测试用例
describe('capitalizeFirstLetter', () => {
it('should capitalize the first letter of a string', () => {
expect(capitalizeFirstLetter('hello')).toBe('Hello');

View File

@@ -13,8 +13,7 @@ describe('uniqueByField', () => {
const uniqueItems = uniqueByField(items, 'id');
// Assert expected results
expect(uniqueItems).toHaveLength(3); // After deduplication, there should be three objects left
expect(uniqueItems).toHaveLength(3);
expect(uniqueItems).toEqual([
{ id: 1, name: 'Item 1' },
{ id: 2, name: 'Item 2' },