mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 00:16:15 -04:00
tests: do not re-add identical text with setText
This commit is contained in:
parent
668d62fa3f
commit
63de249236
1 changed files with 29 additions and 0 deletions
|
@ -461,6 +461,35 @@ describe(__filename, function () {
|
||||||
.expect('Content-Type', /json/);
|
.expect('Content-Type', /json/);
|
||||||
assert.equal(res.body.code, 0);
|
assert.equal(res.body.code, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('does not add an useless revision', async function () {
|
||||||
|
let res = await agent.post(`${endPoint('setText')}&padID=${testPadId}`)
|
||||||
|
.field({text: 'identical text\n'})
|
||||||
|
.expect(200)
|
||||||
|
.expect('Content-Type', /json/);
|
||||||
|
assert.equal(res.body.code, 0);
|
||||||
|
|
||||||
|
res = await agent.get(`${endPoint('getText')}&padID=${testPadId}`)
|
||||||
|
.expect(200)
|
||||||
|
.expect('Content-Type', /json/);
|
||||||
|
assert.equal(res.body.data.text, 'identical text\n');
|
||||||
|
|
||||||
|
res = await agent.get(`${endPoint('getRevisionsCount')}&padID=${testPadId}`)
|
||||||
|
.expect(200)
|
||||||
|
.expect('Content-Type', /json/);
|
||||||
|
const revCount = res.body.data.revisions;
|
||||||
|
|
||||||
|
res = await agent.post(`${endPoint('setText')}&padID=${testPadId}`)
|
||||||
|
.field({text: 'identical text\n'})
|
||||||
|
.expect(200)
|
||||||
|
.expect('Content-Type', /json/);
|
||||||
|
assert.equal(res.body.code, 0);
|
||||||
|
|
||||||
|
res = await agent.get(`${endPoint('getRevisionsCount')}&padID=${testPadId}`)
|
||||||
|
.expect(200)
|
||||||
|
.expect('Content-Type', /json/);
|
||||||
|
assert.equal(res.body.data.revisions, revCount);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('copyPadWithoutHistory', function () {
|
describe('copyPadWithoutHistory', function () {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue