import { it, expect, describe } from 'vitest'; import { obj2propsList } from '@/utils/common'; describe('test obj2propsList', () => { it('obj2propsList', () => { const obj = { '0': '男', '1': '女' }; const list = obj2propsList(obj); expect(list[0].label).eq('男'); expect(list.length).eq(2); expect(list[0].value).eq('0'); expect(obj2propsList(obj, true)[0].value).eq(0); }); });