fix tests and change invitation mechanics
This commit is contained in:
@@ -1013,10 +1013,13 @@ test('shared drafts use guarded server saves, preserve the creator and retain un
|
||||
test('sharing a local draft asks before sending and opens a separate shared copy', async () => {
|
||||
const h = buildEditorContext();
|
||||
const sharedIds = [];
|
||||
const code = Array(5).fill('🐦');
|
||||
let chosen = null;
|
||||
h.context.confirm = () => false;
|
||||
h.context.Wegwichtel.Groups = {
|
||||
shareButton(action) { const button = new FakeElement('', 'button'); button.dataset.editorAction = action; return button; },
|
||||
async share(id) { sharedIds.push(id); }
|
||||
async chooseCode() { return chosen; },
|
||||
async share(id, selected) { assert.equal(selected, code); sharedIds.push(id); }
|
||||
};
|
||||
await loadI18n(h.context);
|
||||
const filename = path.join(root, 'public/js/editor-ui.js');
|
||||
@@ -1027,6 +1030,10 @@ test('sharing a local draft asks before sending and opens a separate shared copy
|
||||
list.dispatchEvent(pointerEvent(item.children[1].children[1]));
|
||||
for (let i = 0; i < 4; i += 1) await tick();
|
||||
assert.equal(h.calls.some(call => call.method === 'POST'), false);
|
||||
chosen = code;
|
||||
list.dispatchEvent(pointerEvent(item.children[1].children[1]));
|
||||
for (let i = 0; i < 4; i += 1) await tick();
|
||||
assert.equal(h.calls.some(call => call.method === 'POST'), false, 'declining transfer sends nothing');
|
||||
h.context.confirm = () => true;
|
||||
list.dispatchEvent(pointerEvent(item.children[1].children[1]));
|
||||
list.dispatchEvent(pointerEvent(item.children[1].children[1]));
|
||||
|
||||
Reference in New Issue
Block a user