Pad: Don't create no-op revisions

This commit is contained in:
Richard Hansen 2021-12-11 20:03:35 -05:00
parent 56b7671422
commit a370cfa5c6
6 changed files with 18 additions and 12 deletions

View file

@ -278,7 +278,7 @@ describe(__filename, function () {
const res = await agent.post(endPoint('setText'))
.send({
padID: testPadId,
text: 'testTextTwo',
text: 'testTextThree',
})
.expect(200)
.expect('Content-Type', /json/);

View file

@ -84,19 +84,19 @@ describe(__filename, function () {
assert.equal(pad.text(), 'hello\n');
});
it('identity changeset is accepted', async function () {
it('identity changeset is accepted, has no effect', async function () {
sendUserChanges('Z:1>5+5$hello');
await assertAccepted(rev + 1);
sendUserChanges('Z:6>0$');
await assertAccepted(rev + 1);
await assertAccepted(rev);
assert.equal(pad.text(), 'hello\n');
});
it('non-identity changeset with no net change is accepted', async function () {
it('non-identity changeset with no net change is accepted, has no effect', async function () {
sendUserChanges('Z:1>5+5$hello');
await assertAccepted(rev + 1);
sendUserChanges('Z:6>0-5+5$hello');
await assertAccepted(rev + 1);
await assertAccepted(rev);
assert.equal(pad.text(), 'hello\n');
});
});