import * as __WEBPACK_EXTERNAL_MODULE__utils_mjs__ from "../utils.mjs";
describe('transformToFilter', ()=>{
    it('should transform to filter', ()=>{
        const values = {
            name: 'name',
            email: 'email',
            user: {
                name: 'name'
            },
            list: [
                {
                    name: 'name1'
                },
                {
                    name: 'name2'
                },
                {
                    name: 'name3'
                }
            ]
        };
        const fieldSchema = {
            'x-filter-operators': {
                name: '$eq',
                email: '$eq'
            }
        };
        const getField = (name)=>{
            if ('user' === name || 'list' === name) return {
                targetKey: 'name'
            };
            return {
                targetKey: void 0
            };
        };
        expect((0, __WEBPACK_EXTERNAL_MODULE__utils_mjs__.transformToFilter)(values, fieldSchema, getField)).toEqual({
            $and: [
                {
                    name: {
                        $eq: 'name'
                    }
                },
                {
                    email: {
                        $eq: 'email'
                    }
                },
                {
                    'user.name': {
                        $eq: 'name'
                    }
                },
                {
                    'list.name': {
                        $eq: [
                            'name1',
                            'name2',
                            'name3'
                        ]
                    }
                }
            ]
        });
    });
});
