Skip to content

Test case to ensure dashboard.parse.com won't break #1635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion spec/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var facebook = require('../src/authDataManager/facebook');
var ParseServer = require('../src/index').ParseServer;
var path = require('path');
var TestUtils = require('../src/index').TestUtils;
var MongoStorageAdapter = require('../src/Adapters/Storage/Mongo/MongoStorageAdapter');

var databaseURI = process.env.DATABASE_URI;
var cloudMain = process.env.CLOUD_CODE_MAIN || './spec/cloud/main.js';
Expand Down Expand Up @@ -87,8 +88,28 @@ beforeEach(function(done) {
return TestUtils.destroyAllDataPermanently().then(done, fail);
});

var mongoAdapter = new MongoStorageAdapter({
collectionPrefix: defaultConfiguration.collectionPrefix,
uri: databaseURI,
})

afterEach(function(done) {
Parse.User.logOut().then(() => {
mongoAdapter.getAllSchemas()
.then(allSchemas => {
allSchemas.forEach(({ className }) => {
expect(className).toEqual({ asymmetricMatch: className => {
if (!className.startsWith('_')) {
return true;
} else {
// Other system classes will break Parse.com, so make sure that we don't save anything to _SCHEMA that will
// break it.
return ['_User', '_Installation', '_Role', '_Session', '_Product'].includes(className);
}
}});
});
})
.then(() => Parse.User.logOut())
.then(() => {
return TestUtils.destroyAllDataPermanently();
}).then(() => {
done();
Expand Down