"use strict";
var __webpack_exports__ = {};
const external_utils_js_namespaceObject = require("../utils.js");
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, external_utils_js_namespaceObject.transformToFilter)(values, fieldSchema, getField)).toEqual({
            $and: [
                {
                    name: {
                        $eq: 'name'
                    }
                },
                {
                    email: {
                        $eq: 'email'
                    }
                },
                {
                    'user.name': {
                        $eq: 'name'
                    }
                },
                {
                    'list.name': {
                        $eq: [
                            'name1',
                            'name2',
                            'name3'
                        ]
                    }
                }
            ]
        });
    });
});
var __webpack_export_target__ = exports;
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
    value: true
});
