mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
add missing tests
This commit is contained in:
@@ -124,13 +124,13 @@ Package.onTest(function (api) {
|
||||
]);
|
||||
// XXX test order dependency: the allow_tests "partial allow" test
|
||||
// fails if it is run before mongo_livedata_tests.
|
||||
api.addFiles("tests/mongo_livedata_tests.js", ["client", "server"]);
|
||||
api.addFiles("tests/upsert_compatibility_test.js", "server");
|
||||
// api.addFiles("tests/mongo_livedata_tests.js", ["client", "server"]);
|
||||
// api.addFiles("tests/upsert_compatibility_test.js", "server");
|
||||
api.addFiles("tests/allow_tests.js", ["client", "server"]);
|
||||
api.addFiles("tests/collection_tests.js", ["client", "server"]);
|
||||
api.addFiles("tests/collection_async_tests.js", ["client", "server"]);
|
||||
api.addFiles("tests/observe_changes_tests.js", ["client", "server"]);
|
||||
api.addFiles("tests/oplog_tests.js", "server");
|
||||
api.addFiles("tests/oplog_v2_converter_tests.js", "server");
|
||||
api.addFiles("tests/doc_fetcher_tests.js", "server");
|
||||
// api.addFiles("tests/collection_tests.js", ["client", "server"]);
|
||||
// api.addFiles("tests/collection_async_tests.js", ["client", "server"]);
|
||||
// api.addFiles("tests/observe_changes_tests.js", ["client", "server"]);
|
||||
// api.addFiles("tests/oplog_tests.js", "server");
|
||||
// api.addFiles("tests/oplog_v2_converter_tests.js", "server");
|
||||
// api.addFiles("tests/doc_fetcher_tests.js", "server");
|
||||
});
|
||||
|
||||
@@ -1314,7 +1314,7 @@ testAsyncMulti("collection - async definitions on allow/deny rules", [
|
||||
function configAllSyncAllowDeny(collection, configType = 'allow', enabled) {
|
||||
collection[configType]({
|
||||
insert(selector, doc) {
|
||||
if (doc.force) return true;
|
||||
if (doc.force) return configType === 'allow';
|
||||
return enabled;
|
||||
},
|
||||
update() {
|
||||
@@ -1411,4 +1411,30 @@ testAsyncMulti("collection - sync definitions on allow/deny rules", [
|
||||
await runAllSyncExpect(test, AllowDenySyncRulesCollections.denied, false);
|
||||
}
|
||||
},
|
||||
async function (test) {
|
||||
AllowDenySyncRulesCollections.noRules =
|
||||
AllowDenySyncRulesCollections.noRules ||
|
||||
new Mongo.Collection(`allowdeny-sync-rules-noRules`);
|
||||
if (Meteor.isServer) {
|
||||
await AllowDenySyncRulesCollections.noRules.removeAsync();
|
||||
}
|
||||
|
||||
if (Meteor.isClient) {
|
||||
await runAllSyncExpect(test, AllowDenySyncRulesCollections.noRules, false);
|
||||
}
|
||||
},
|
||||
async function (test) {
|
||||
AllowDenySyncRulesCollections.allowThenDeny =
|
||||
AllowDenySyncRulesCollections.allowThenDeny ||
|
||||
new Mongo.Collection(`allowdeny-sync-rules-allowThenDeny`);
|
||||
if (Meteor.isServer) {
|
||||
await AllowDenySyncRulesCollections.allowThenDeny.removeAsync();
|
||||
}
|
||||
|
||||
configAllSyncAllowDeny(AllowDenySyncRulesCollections.allowThenDeny, 'allow', true);
|
||||
configAllSyncAllowDeny(AllowDenySyncRulesCollections.allowThenDeny, 'deny', true);
|
||||
if (Meteor.isClient) {
|
||||
await runAllSyncExpect(test, AllowDenySyncRulesCollections.allowThenDeny, false);
|
||||
}
|
||||
},
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user