feat(tasks): add explicit deletion with DAV tombstones
This commit is contained in:
1 parent
dc978231e2
commit
38a4fcf530
15 files changed
+530
-10
No files matched your search
@@ -40,6 +40,8 @@ window.addEventListener('load',async()=>{const wait=async(fn)=>{for(let i=0;i<12
|
||||
}else if(path==='/v/plan/dashboard'){
|
||||
await wait(()=>document.querySelectorAll('.productivity-day').length>300);if(!document.querySelector('.productivity-day[data-level="2"]'))throw Error('Seven-point completion missing');
|
||||
if(document.querySelectorAll('[data-widget]').length!==6)throw Error('Widget registry missing');
|
||||
await wait(()=>document.querySelector('[data-widget=progress] .dashboard-progress'));
|
||||
if(document.querySelector('[data-widget=progress] .widget-body small'))throw Error('Completion widget explanation should not be displayed');
|
||||
const tab=document.querySelector('[data-tab=done]');tab.click();await wait(()=>document.querySelector('#widget-panel-tasks').textContent.includes('Browser work task'));if(location.pathname!=='/v/plan/dashboard'||document.querySelector('#organizer-dashboard iframe'))throw Error('Tab navigation escaped widget');
|
||||
document.querySelector('#dashboard-controls button[aria-pressed]').click();const width=document.querySelector('[data-widget=tasks] [data-size=width]');width.value='6';width.dispatchEvent(new Event('change'));const height=document.querySelector('[data-widget=tasks] [data-size=height]');height.value='5';height.dispatchEvent(new Event('change'));
|
||||
document.querySelector('[data-widget=tasks] .widget-arrange button').click();document.querySelector('#dashboard-controls button:last-child').click();await wait(()=>document.querySelector('#dashboard-status').textContent.includes('保存しました'));const layout=await fetch('/_/api/v1/extension/organizer.tasks/dashboard').then(r=>r.json());if(layout.widgets[2].id!=='tasks'||layout.widgets[2].width!==6||layout.widgets[2].height!==5||layout.widgets[2].tab!=='done')throw Error('Layout did not persist');
|
||||
|
||||
+20
@@ -130,6 +130,26 @@ window.addEventListener('load', async () => {
|
||||
document.body.dataset.vimReady='true';return;
|
||||
}
|
||||
await wait(()=>$('status').textContent.includes('ありません'));
|
||||
// Deletion shares the archive footer, not a UUID-search workflow.
|
||||
$('new').click();await wait(()=>document.querySelector('#tasks-form [name=title]'));
|
||||
if(!$('delete').hidden)throw Error('Unsaved task must not offer deletion');$('close').click();
|
||||
$('quick-title').value='Disposable deletion fixture';$('capture').requestSubmit();
|
||||
await wait(()=>$('list').querySelector('[data-action=detail]'));$('list').querySelector('[data-action=detail]').click();
|
||||
await wait(()=>!$('delete').hidden);
|
||||
if($('delete').parentElement!==$('archive').parentElement||$('delete').textContent!=='削除')throw Error('Delete action is not beside archive');
|
||||
const deletionID=$('list').querySelector('[data-task-id]').dataset.taskId;
|
||||
window.confirm=()=>false;$('delete').click();
|
||||
if(!$('dialog').open)throw Error('Cancelled deletion closed the editor');
|
||||
const deletionAPI='/_/api/v1/extension/organizer.tasks/items/'+deletionID;
|
||||
const deletionItem=(await fetch(deletionAPI).then(r=>r.json())).item;
|
||||
const changed=await fetch(deletionAPI,{method:'PUT',headers:{'Content-Type':'application/json','If-Match':'"'+deletionItem.version+'"'},body:JSON.stringify({...deletionItem,title:'Updated deletion fixture'})});
|
||||
if(!changed.ok)throw Error('Deletion conflict fixture failed');
|
||||
window.confirm=()=>true;$('delete').click();await wait(()=>$('error').textContent.includes('別の画面'));
|
||||
if(!$('dialog').open||$('delete').disabled)throw Error('Deletion failure did not keep a usable editor');
|
||||
$('close').click();$('refresh').click();await wait(()=>$('list').querySelector('input[name=title]')?.value==='Updated deletion fixture');
|
||||
$('list').querySelector('[data-action=detail]').click();await wait(()=>!$('delete').hidden);$('delete').click();
|
||||
await wait(()=>!$('dialog').open&&!$('list').querySelector('[data-task-id]'));
|
||||
if((await fetch(deletionAPI)).status!==404)throw Error('Deleted task remains readable');
|
||||
$('quick-title').value='Write the first task';$('capture').requestSubmit();
|
||||
await wait(()=>$('list').querySelector('[data-action=detail]'));
|
||||
$('list').querySelector('[data-action=detail]').click();
|
||||
|
||||
Reference in new issue
Block a user