File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 605
605
606
606
});
607
607
608
- it ('can get correct data with providing filter fn:`between` and datatype:`date` ' , function () {
608
+ it ('can get correct data with providing filter fn:`between` and datatype:`date` with selecting only specific columns ' , function () {
609
609
610
610
$ expectedUsers = User::factory ()
611
611
->count (5 )
635
635
];
636
636
637
637
$ allowedFilters = array ('created_at ' );
638
+ $ allowedSelects = array ('username ' , 'email ' , 'age ' );
638
639
639
640
$ data = (new Datatable ())->run (
640
641
$ query ,
641
642
$ requestParameters ,
642
- $ allowedFilters
643
+ $ allowedFilters ,
644
+ allowedSelects: $ allowedSelects
643
645
);
644
646
645
- $ expected = $ expectedUsers ->toArray ();
647
+ $ expected = $ expectedUsers ->map -> only ( $ allowedSelects )-> toArray ();
646
648
647
649
expect ($ data ['data ' ])
648
650
->toEqual ($ expected );
959
961
//sorting
960
962
// filter with rel
961
963
// include relations test :)
964
+ // allowed select test
You can’t perform that action at this time.
0 commit comments