mirror of
https://github.com/vale981/grapher
synced 2025-03-04 17:11:38 -05:00
Fixed internal testing process
This commit is contained in:
parent
33878ddc8d
commit
2a99080d94
3 changed files with 28 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
||||||
import { assert } from 'chai';
|
import { assert } from 'chai';
|
||||||
|
|
||||||
//import {
|
//import {
|
||||||
// PostCollection,
|
// PostCollection,
|
||||||
// CategoryCollection,
|
// CategoryCollection,
|
||||||
|
|
|
@ -822,4 +822,30 @@ describe('Hypernova', function() {
|
||||||
// no link storage
|
// no link storage
|
||||||
assert.isUndefined(user.shoppingCartsData);
|
assert.isUndefined(user.shoppingCartsData);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('Should be able to work with custom $filter function and using $and', () => {
|
||||||
|
ShoppingCart.remove({});
|
||||||
|
ShoppingCart.insert({ value: 1 });
|
||||||
|
ShoppingCart.insert({ value: 2 });
|
||||||
|
ShoppingCart.insert({ value: 3 });
|
||||||
|
ShoppingCart.insert({ value: 4 });
|
||||||
|
|
||||||
|
const data = ShoppingCart.createQuery({
|
||||||
|
$filter({
|
||||||
|
filters,
|
||||||
|
params
|
||||||
|
}) {
|
||||||
|
let $or = [];
|
||||||
|
params.values.forEach(v => $or.push({ value: v }));
|
||||||
|
|
||||||
|
filters.$or = $or;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
params: {
|
||||||
|
values: [1, 2]
|
||||||
|
}
|
||||||
|
}).fetch();
|
||||||
|
|
||||||
|
assert.lengthOf(data, 2);
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
|
@ -30,8 +30,8 @@ Package.onUse(function(api) {
|
||||||
'matb33:collection-hooks@0.8.4',
|
'matb33:collection-hooks@0.8.4',
|
||||||
'reywood:publish-composite@1.5.2',
|
'reywood:publish-composite@1.5.2',
|
||||||
'dburles:mongo-collection-instances@0.3.5',
|
'dburles:mongo-collection-instances@0.3.5',
|
||||||
'herteby:denormalize@0.6.5',
|
|
||||||
'peerlibrary:subscription-scope@0.4.0',
|
'peerlibrary:subscription-scope@0.4.0',
|
||||||
|
'herteby:denormalize@0.6.5',
|
||||||
];
|
];
|
||||||
|
|
||||||
api.use(packages);
|
api.use(packages);
|
||||||
|
@ -50,7 +50,6 @@ Package.onTest(function(api) {
|
||||||
'reywood:publish-composite@1.5.2',
|
'reywood:publish-composite@1.5.2',
|
||||||
'dburles:mongo-collection-instances@0.3.5',
|
'dburles:mongo-collection-instances@0.3.5',
|
||||||
'herteby:denormalize@0.6.5',
|
'herteby:denormalize@0.6.5',
|
||||||
'peerlibrary:subscription-scope@0.4.0',
|
|
||||||
'mongo',
|
'mongo',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue