Skip to content
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

Required fields and default values #5835

Merged
merged 13 commits into from
Jul 26, 2019
18 changes: 9 additions & 9 deletions spec/RedisCacheAdapter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ describe_only(() => {
const object = new TestObject();
object.set('foo', 'bar');
await object.save();
expect(getSpy.calls.count()).toBe(2);
expect(getSpy.calls.count()).toBe(3);
expect(putSpy.calls.count()).toBe(2);
});

Expand All @@ -201,7 +201,7 @@ describe_only(() => {
booleanField: true,
});
await container.save();
expect(getSpy.calls.count()).toBe(2);
expect(getSpy.calls.count()).toBe(3);
expect(putSpy.calls.count()).toBe(2);
});

Expand All @@ -215,7 +215,7 @@ describe_only(() => {

object.set('foo', 'barz');
await object.save();
expect(getSpy.calls.count()).toBe(2);
expect(getSpy.calls.count()).toBe(3);
expect(putSpy.calls.count()).toBe(0);
});

Expand All @@ -233,7 +233,7 @@ describe_only(() => {
objects.push(object);
}
await Parse.Object.saveAll(objects);
expect(getSpy.calls.count()).toBe(11);
expect(getSpy.calls.count()).toBe(21);
expect(putSpy.calls.count()).toBe(10);

getSpy.calls.reset();
Expand All @@ -258,7 +258,7 @@ describe_only(() => {
objects.push(object);
}
await Parse.Object.saveAll(objects, { batchSize: 5 });
expect(getSpy.calls.count()).toBe(12);
expect(getSpy.calls.count()).toBe(22);
expect(putSpy.calls.count()).toBe(5);

getSpy.calls.reset();
Expand All @@ -279,7 +279,7 @@ describe_only(() => {

object.set('new', 'barz');
await object.save();
expect(getSpy.calls.count()).toBe(2);
expect(getSpy.calls.count()).toBe(3);
expect(putSpy.calls.count()).toBe(1);
});

Expand All @@ -299,7 +299,7 @@ describe_only(() => {
booleanField: true,
});
await object.save();
expect(getSpy.calls.count()).toBe(2);
expect(getSpy.calls.count()).toBe(3);
expect(putSpy.calls.count()).toBe(1);
});

Expand All @@ -309,7 +309,7 @@ describe_only(() => {
user.setPassword('testing');
await user.signUp();

expect(getSpy.calls.count()).toBe(6);
expect(getSpy.calls.count()).toBe(8);
expect(putSpy.calls.count()).toBe(1);
});

Expand All @@ -326,7 +326,7 @@ describe_only(() => {

object.set('foo', 'bar');
await object.save();
expect(getSpy.calls.count()).toBe(3);
expect(getSpy.calls.count()).toBe(4);
expect(putSpy.calls.count()).toBe(1);

getSpy.calls.reset();
Expand Down
26 changes: 13 additions & 13 deletions spec/Schema.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ describe('SchemaController', () => {
schema
.addClassIfNotExists('_InvalidName', { foo: { type: 'String' } })
.catch(error => {
expect(error.error).toEqual(
expect(error.message).toEqual(
'Invalid classname: _InvalidName, classnames can only have alphanumeric characters and _, and must start with an alpha character '
);
done();
Expand All @@ -522,7 +522,7 @@ describe('SchemaController', () => {
)
.catch(error => {
expect(error.code).toEqual(Parse.Error.INVALID_KEY_NAME);
expect(error.error).toEqual('invalid field name: 0InvalidName');
expect(error.message).toEqual('invalid field name: 0InvalidName');
done();
});
});
Expand All @@ -535,7 +535,7 @@ describe('SchemaController', () => {
)
.catch(error => {
expect(error.code).toEqual(136);
expect(error.error).toEqual('field objectId cannot be added');
expect(error.message).toEqual('field objectId cannot be added');
done();
});
});
Expand All @@ -550,7 +550,7 @@ describe('SchemaController', () => {
)
.catch(error => {
expect(error.code).toEqual(136);
expect(error.error).toEqual('field localeIdentifier cannot be added');
expect(error.message).toEqual('field localeIdentifier cannot be added');
done();
});
});
Expand All @@ -565,7 +565,7 @@ describe('SchemaController', () => {
)
.catch(error => {
expect(error.code).toEqual(Parse.Error.INVALID_JSON);
expect(error.error).toEqual('invalid JSON');
expect(error.message).toEqual('invalid JSON');
done();
});
});
Expand All @@ -580,7 +580,7 @@ describe('SchemaController', () => {
)
.catch(error => {
expect(error.code).toEqual(135);
expect(error.error).toEqual('type Pointer needs a class name');
expect(error.message).toEqual('type Pointer needs a class name');
done();
});
});
Expand All @@ -595,7 +595,7 @@ describe('SchemaController', () => {
)
.catch(error => {
expect(error.code).toEqual(Parse.Error.INVALID_JSON);
expect(error.error).toEqual('invalid JSON');
expect(error.message).toEqual('invalid JSON');
done();
});
});
Expand All @@ -610,7 +610,7 @@ describe('SchemaController', () => {
)
.catch(error => {
expect(error.code).toEqual(135);
expect(error.error).toEqual('type Relation needs a class name');
expect(error.message).toEqual('type Relation needs a class name');
done();
});
});
Expand All @@ -625,7 +625,7 @@ describe('SchemaController', () => {
)
.catch(error => {
expect(error.code).toEqual(Parse.Error.INVALID_JSON);
expect(error.error).toEqual('invalid JSON');
expect(error.message).toEqual('invalid JSON');
done();
});
});
Expand All @@ -640,7 +640,7 @@ describe('SchemaController', () => {
)
.catch(error => {
expect(error.code).toEqual(Parse.Error.INVALID_CLASS_NAME);
expect(error.error).toEqual(
expect(error.message).toEqual(
'Invalid classname: not a valid class name, classnames can only have alphanumeric characters and _, and must start with an alpha character '
);
done();
Expand All @@ -657,7 +657,7 @@ describe('SchemaController', () => {
)
.catch(error => {
expect(error.code).toEqual(Parse.Error.INVALID_CLASS_NAME);
expect(error.error).toEqual(
expect(error.message).toEqual(
'Invalid classname: not a valid class name, classnames can only have alphanumeric characters and _, and must start with an alpha character '
);
done();
Expand All @@ -674,7 +674,7 @@ describe('SchemaController', () => {
)
.catch(error => {
expect(error.code).toEqual(Parse.Error.INCORRECT_TYPE);
expect(error.error).toEqual('invalid field type: Unknown');
expect(error.message).toEqual('invalid field type: Unknown');
done();
});
});
Expand Down Expand Up @@ -929,7 +929,7 @@ describe('SchemaController', () => {
)
.catch(error => {
expect(error.code).toEqual(Parse.Error.INCORRECT_TYPE);
expect(error.error).toEqual(
expect(error.message).toEqual(
'currently, only one GeoPoint field may exist in an object. Adding geo2 when geo1 already exists.'
);
done();
Expand Down
Loading