Add test for conflicts where both deleted

This commit is contained in:
Ritchie Martori 2014-05-16 09:58:23 -07:00
parent d58df51540
commit 4d5e7884c2
1 changed files with 19 additions and 1 deletions

View File

@ -178,7 +178,7 @@ describe('Change', function(){
}); });
}); });
describe('Change.type()', function () { describe('change.type()', function () {
it('CREATE', function () { it('CREATE', function () {
var change = new Change({ var change = new Change({
rev: this.revisionForModel rev: this.revisionForModel
@ -226,6 +226,24 @@ describe('Change', function(){
assert.equal(change.equals(otherChange), true); assert.equal(change.equals(otherChange), true);
}); });
it('should return true when both changes are deletes', function () {
var REV = 'foo';
var change = new Change({
rev: null,
prev: REV,
});
var otherChange = new Change({
rev: undefined,
prev: REV
});
assert.equal(change.type(), Change.DELETE);
assert.equal(otherChange.type(), Change.DELETE);
assert.equal(change.equals(otherChange), true);
});
}); });
describe('change.isBasedOn(otherChange)', function () { describe('change.isBasedOn(otherChange)', function () {