feat: add previewed atomic OPML subscription import and export
Build and publish container images / images (push) Failing after 7m31s
Build and publish container images / images (push) Failing after 7m31s
This commit is contained in:
1 parent
38daea737d
commit
7fe64113c7
13 files changed
+782
-8
No files matched your search
Vendored
+8
-1
@@ -19,6 +19,13 @@
|
||||
d.querySelector('#feed-reader .feed-actions button:last-child').click();await wait(()=>d.querySelector('#feed-reader form'));
|
||||
const form=d.querySelector('#feed-reader form'),inputs=form.querySelectorAll('input');inputs[2].value='/notes/feed-ui';inputs[2].dispatchEvent(new w.Event('input'));inputs[5].checked=true;form.requestSubmit();await wait(()=>d.querySelector('#feed-reader a[href^="/v/uuid:"]'));
|
||||
const search=d.querySelector('#feed-toolbar input');search.value='';search.dispatchEvent(new w.Event('input',{bubbles:true}));await wait(()=>d.querySelectorAll('.feed-row').length===100);d.querySelector('.feed-row').click();await wait(()=>d.querySelector('#feed-reader .feed-body'));
|
||||
assert(d.documentElement.scrollWidth<=w.innerWidth,'Reader overflow');document.body.dataset.vimReady='1';
|
||||
assert(d.documentElement.scrollWidth<=w.innerWidth,'Reader overflow');
|
||||
d.getElementById('feed-opml').click();await wait(()=>d.getElementById('feed-opml-file'));
|
||||
const opml='<opml version="2.0"><head><title>Import</title></head><body><outline text="技術"><outline type="rss" text="Import '+w.innerWidth+'" xmlUrl="https://example.org/ui-'+w.innerWidth+'"/><outline type="rss" text="Existing" xmlUrl="https://example.org/feed.xml"/><outline type="rss" text="Private" xmlUrl="https://127.0.0.1/feed"/></outline></body></opml>';
|
||||
const choose=()=>{const transfer=new w.DataTransfer();transfer.items.add(new w.File([opml],'feeds.opml',{type:'text/x-opml'}));const f=d.getElementById('feed-opml-file');f.files=transfer.files;f.dispatchEvent(new w.Event('change',{bubbles:true}));};choose();
|
||||
await wait(()=>d.querySelectorAll('#feed-opml-preview tbody tr').length===3);const checks=d.querySelectorAll('#feed-opml-preview tbody input');assert(checks[0].checked&&!checks[0].disabled&&checks[1].disabled&&checks[2].disabled,'Import eligibility');
|
||||
assert(d.documentElement.scrollWidth<=w.innerWidth,'OPML overflow');d.querySelector('.feed-import-options input[type=checkbox]').checked=false;d.getElementById('feed-opml-preview').requestSubmit();await wait(()=>!d.getElementById('feed-opml-preview'));
|
||||
assert(d.getElementById('feed-sources').textContent.includes('Import '+w.innerWidth),'Imported source missing');d.getElementById('feed-opml').click();await wait(()=>d.getElementById('feed-opml-file'));choose();await wait(()=>d.querySelectorAll('#feed-opml-preview tbody tr').length===3);assert(d.querySelector('#feed-opml-preview tbody input').disabled,'Duplicate after import');
|
||||
assert(d.documentElement.scrollWidth<=w.innerWidth,'OPML preview overflow');document.body.dataset.vimReady='1';
|
||||
}catch(e){const out=document.createElement('pre');out.id='error';out.textContent=e.stack;document.body.append(out);}
|
||||
})();
|
||||
Reference in new issue
Block a user