mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-23 18:50:06 +08:00
chore: delete unuse file and test
This commit is contained in:
parent
012dc7f03e
commit
14b1f56435
@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -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(',')})`,
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user