Postgres exclude failing tests (#2081)
* reload the right data More passing postgres tests Handle schema updates, and $in for non array columns remove authdata from user and implement ensureUniqueness Make some tests work, detect existing classes Throw proper error for unique index violation fix findOneAndUpdate Support more types support more type Support boolean, fix _rperm/_wperm, add TODO Support string types and also simplify tests Move operator flattening into Parse Server and out of mongo adapters Move authdata transform for create into Parse Server Move authdata transforms completely in to Parse Server Fix test setup inline addSchema Inject default schema to response from DB adapter * Mark tests that don't work in Postgres * Exclude one more test * Exclude some more failing tests * Exclude more tests
This commit is contained in:
@@ -250,11 +250,6 @@ const parseObjectKeyValueToMongoObjectKeyValue = (restKey, restValue, schema) =>
|
||||
return {key: restKey, value: value};
|
||||
}
|
||||
|
||||
// Handle update operators. TODO: handle within Parse Server. DB adapter shouldn't see update operators in creates.
|
||||
if (typeof restValue === 'object' && '__op' in restValue) {
|
||||
return {key: restKey, value: transformUpdateOperator(restValue, true)};
|
||||
}
|
||||
|
||||
// Handle normal objects by recursing
|
||||
if (Object.keys(restValue).some(key => key.includes('$') || key.includes('.'))) {
|
||||
throw new Parse.Error(Parse.Error.INVALID_NESTED_KEY, "Nested keys should not contain the '$' or '.' characters");
|
||||
@@ -264,9 +259,6 @@ const parseObjectKeyValueToMongoObjectKeyValue = (restKey, restValue, schema) =>
|
||||
}
|
||||
|
||||
const parseObjectToMongoObjectForCreate = (className, restCreate, schema) => {
|
||||
if (className == '_User') {
|
||||
restCreate = transformAuthData(restCreate);
|
||||
}
|
||||
restCreate = addLegacyACL(restCreate);
|
||||
let mongoCreate = {}
|
||||
for (let restKey in restCreate) {
|
||||
@@ -295,10 +287,6 @@ const parseObjectToMongoObjectForCreate = (className, restCreate, schema) => {
|
||||
|
||||
// Main exposed method to help update old objects.
|
||||
const transformUpdate = (className, restUpdate, parseFormatSchema) => {
|
||||
if (className == '_User') {
|
||||
restUpdate = transformAuthData(restUpdate);
|
||||
}
|
||||
|
||||
let mongoUpdate = {};
|
||||
let acl = addLegacyACL(restUpdate)._acl;
|
||||
if (acl) {
|
||||
@@ -331,23 +319,6 @@ const transformUpdate = (className, restUpdate, parseFormatSchema) => {
|
||||
return mongoUpdate;
|
||||
}
|
||||
|
||||
function transformAuthData(restObject) {
|
||||
if (restObject.authData) {
|
||||
Object.keys(restObject.authData).forEach((provider) => {
|
||||
let providerData = restObject.authData[provider];
|
||||
if (providerData == null) {
|
||||
restObject[`_auth_data_${provider}`] = {
|
||||
__op: 'Delete'
|
||||
}
|
||||
} else {
|
||||
restObject[`_auth_data_${provider}`] = providerData;
|
||||
}
|
||||
});
|
||||
delete restObject.authData;
|
||||
}
|
||||
return restObject;
|
||||
}
|
||||
|
||||
// Add the legacy _acl format.
|
||||
const addLegacyACL = restObject => {
|
||||
let restObjectCopy = {...restObject};
|
||||
|
||||
Reference in New Issue
Block a user