chore: delete unuse file and test

This commit is contained in:
🏎️ Yumo 2024-07-23 19:24:33 +08:00
parent 012dc7f03e
commit 14b1f56435
2 changed files with 0 additions and 45 deletions

View File

@ -1,5 +1,4 @@
import getAlphaColor from '../util/getAlphaColor';
import genMaxMin from '../util/maxmin';
describe('util', () => {
describe('getAlphaColor', () => {
@ -7,34 +6,4 @@ describe('util', () => {
expect(getAlphaColor('rgba(0, 0, 0, 0.5)', 'rgba(255, 255, 255)')).toBe('rgba(0, 0, 0, 0.5)');
});
});
describe('maxmin', () => {
const cases = [
{
values: [1, 2, 3],
js: {
max: 3,
min: 1,
},
css: {
max: 'max(1px,2px,3px)',
min: 'min(1px,2px,3px)',
},
},
];
cases.forEach(({ values, js, css }, index) => {
it(`js maxmin ${index + 1}`, () => {
const { max, min } = genMaxMin('js');
expect(max(...values)).toEqual(js.max);
expect(min(...values)).toEqual(js.min);
});
it(`css maxmin ${index + 1}`, () => {
const { max, min } = genMaxMin('css');
expect(max(...values)).toEqual(css.max);
expect(min(...values)).toEqual(css.min);
});
});
});
});

View File

@ -1,14 +0,0 @@
import { unit } from '@ant-design/cssinjs';
export default function genMaxMin(type: 'css' | 'js') {
if (type === 'js') {
return {
max: Math.max,
min: Math.min,
};
}
return {
max: (...args: (string | number)[]) => `max(${args.map((value) => unit(value)).join(',')})`,
min: (...args: (string | number)[]) => `min(${args.map((value) => unit(value)).join(',')})`,
};
}