mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 00:46:16 -04:00
ImportEtherpad: Don't make any changes if data is bad
This commit is contained in:
parent
a2e77a7128
commit
23f8a12922
2 changed files with 22 additions and 2 deletions
|
@ -62,6 +62,16 @@ describe(__filename, function () {
|
|||
assert(await db.get(badKey) == null);
|
||||
});
|
||||
|
||||
it('changes are all or nothing', async function () {
|
||||
const authorId = makeAuthorId();
|
||||
const data = makeExport(authorId);
|
||||
data['pad:differentPadId:revs:0'] = data['pad:testing:revs:0'];
|
||||
delete data['pad:testing:revs:0'];
|
||||
assert.rejects(importEtherpad.setPadRaw(padId, JSON.stringify(data)), /unexpected pad ID/);
|
||||
assert(!await authorManager.doesAuthorExist(authorId));
|
||||
assert(!await padManager.doesPadExist(padId));
|
||||
});
|
||||
|
||||
describe('author pad IDs', function () {
|
||||
let existingAuthorId;
|
||||
let newAuthorId;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue