File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -1822,12 +1822,19 @@ describe('ProtectedFields', function () {
18221822 ) ;
18231823 } ) ;
18241824
1825- it ( 'should handle malformed $or with null element' , async function ( ) {
1826- const query = new Parse . Query ( Parse . User ) ;
1827- query . withJSON ( { where : { $or : [ null , { username : 'test' } ] } } ) ;
1828- // Should not throw TypeError from denyProtectedFields;
1829- // may fail downstream in validateQuery (pre-existing issue)
1830- await expectAsync ( query . find ( ) ) . toBeRejected ( ) ;
1825+ it ( 'should not throw TypeError in denyProtectedFields for null element in $or' , async function ( ) {
1826+ const Config = require ( '../lib/Config' ) ;
1827+ const authModule = require ( '../lib/Auth' ) ;
1828+ const RestQuery = require ( '../lib/RestQuery' ) ;
1829+ const config = Config . get ( Parse . applicationId ) ;
1830+ const restQuery = await RestQuery ( {
1831+ method : RestQuery . Method . find ,
1832+ config,
1833+ auth : authModule . nobody ( config ) ,
1834+ className : '_User' ,
1835+ restWhere : { $or : [ null , { username : 'test' } ] } ,
1836+ } ) ;
1837+ await expectAsync ( restQuery . denyProtectedFields ( ) ) . toBeResolved ( ) ;
18311838 } ) ;
18321839 } ) ;
18331840} ) ;
You can’t perform that action at this time.
0 commit comments