{"size": 716, "ext": "js", "max_stars_repo_path": "frontend/src/tests/filters.test.js", "max_stars_repo_name": "jonthemango/coveo-demo", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "frontend/src/tests/filters.test.js", "max_issues_repo_name": "jonthemango/coveo-demo", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "frontend/src/tests/filters.test.js", "max_forks_repo_name": "jonthemango/coveo-demo", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 21.696969697, "max_line_length": 103, "alphanum_fraction": 0.6466480447}
import {serializeToString} from '../algorithms/filters';

const filterTestObj = {
    "Vin rouge": true,
    "Vin blanc": true,
    "Vin rosé": false
}

const filterTestObj2 = {
    "Vin rouge": true,
}

const filterTestObj3 = {
    "Vin rouge": false
}



test('3 values, 3 true 1 false', ()=>{
    expect(serializeToString("tpcategorie",filterTestObj)).toBe('@tpcategorie==(Vin rouge,Vin blanc)');
})

test('1 true value', ()=>{
    expect(serializeToString("tpcategorie",filterTestObj2)).toBe('@tpcategorie==(Vin rouge)');
})

test('1 false value', ()=>{
    expect(serializeToString("tpcategorie",filterTestObj3)).toBe('');
})

test('no values', ()=>{
    expect(serializeToString("tpcategorie",{})).toBe('');
})