mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
tests: fix for appendRevision test
This commit is contained in:
parent
4cf1be966d
commit
cd6da7335b
2 changed files with 26 additions and 18 deletions
|
@ -17,6 +17,7 @@ let apiVersion = 1;
|
|||
const testPadId = makeid();
|
||||
const newPadId = makeid();
|
||||
const copiedPadId = makeid();
|
||||
const anotherPadId = makeid();
|
||||
let lastEdited = '';
|
||||
const text = generateLongText();
|
||||
|
||||
|
@ -502,6 +503,31 @@ describe(__filename, function () {
|
|||
.expect('Content-Type', /json/);
|
||||
assert.equal(res.body.data.revisions, revCount);
|
||||
});
|
||||
|
||||
it('creates a new Pad with empty text', async function () {
|
||||
await agent.get(`${endPoint('createPad')}&padID=${anotherPadId}&text=`)
|
||||
.expect('Content-Type', /json/)
|
||||
.expect(200)
|
||||
.expect((res) => {
|
||||
assert.equal(res.body.code, 0, 'Unable to create new Pad');
|
||||
});
|
||||
await agent.get(`${endPoint('getText')}&padID=${anotherPadId}`)
|
||||
.expect('Content-Type', /json/)
|
||||
.expect(200)
|
||||
.expect((res) => {
|
||||
assert.equal(res.body.code, 0, 'Unable to get pad text');
|
||||
assert.equal(res.body.data.text, '\n', 'Pad text is not empty');
|
||||
});
|
||||
});
|
||||
|
||||
it('deletes with empty text', async function () {
|
||||
await agent.get(`${endPoint('deletePad')}&padID=${anotherPadId}`)
|
||||
.expect('Content-Type', /json/)
|
||||
.expect(200)
|
||||
.expect((res) => {
|
||||
assert.equal(res.body.code, 0, 'Unable to delete empty Pad');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('copyPadWithoutHistory', function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue