2022-09-07 14:49:54 +08:00
|
|
|
import { expect, it, describe } from 'vitest';
|
2024-05-09 17:16:14 +08:00
|
|
|
import { hijackElementProps } from '../src/style';
|
2022-09-07 14:49:54 +08:00
|
|
|
|
|
|
|
describe('hijack element', () => {
|
|
|
|
it('hijackElementProps basic', () => {
|
|
|
|
const props = hijackElementProps({ data: '', number: 1, fontSize: '12rpx' });
|
|
|
|
expect(props).toStrictEqual({
|
|
|
|
data: '', number: 1, fontSize: '12rpx',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('hijackElementProps style', () => {
|
|
|
|
const props = hijackElementProps({ style: { fontSize: 14, height: '12px', with: '12rpx' } });
|
|
|
|
expect(props).toStrictEqual({
|
|
|
|
style: {
|
|
|
|
fontSize: 14,
|
|
|
|
height: '12px',
|
|
|
|
with: '1.6vw',
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
2024-05-09 17:16:14 +08:00
|
|
|
});
|