Browser suite: ipxd list, a feed that moves for good, Atom with a bare ampersand (#463)
API coverage 78.0% to 80.0% (9174 of 11467 lines): follow_move and the catalogue's list, and the parser's retry of an escaped Atom feed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -702,10 +702,12 @@ test('a feed that starts failing says why, and after a day in words with somethi
|
||||
await expect(page.locator('#content [data-ffail="newurl"]')).toBeVisible();
|
||||
}
|
||||
}
|
||||
// Back again: the error goes, and so does the banner.
|
||||
await flip('ok');
|
||||
// Back again, from the address it moved to for good: the error goes, and the feed is read
|
||||
// from there from now on.
|
||||
await flip('moved');
|
||||
await page.request.post('/api/fetch', { data: { feed: id, force: true } });
|
||||
await expect.poll(async () => (await feed()).last_error, { timeout: 20_000 }).toBeNull();
|
||||
await expect.poll(async () => (await feed()).url, { timeout: 20_000 }).toBe(`${F}/moved.xml`);
|
||||
} finally {
|
||||
await flip('ok');
|
||||
await page.request.delete(`/api/feeds/${encodeURIComponent(id)}`);
|
||||
@@ -1133,8 +1135,9 @@ test('ipxd user adds, lists, renames and removes accounts, and says what is wron
|
||||
fs.rmSync(dir, { recursive: true, force: true });
|
||||
fs.mkdirSync(path.join(dir, 'data'), { recursive: true });
|
||||
fs.writeFileSync(path.join(dir, 'config.toml'),
|
||||
`[general]\ndownload_dir = "${dir}/downloads"\nsocket = "${dir}/ipx.sock"\n`);
|
||||
`[general]\ndownload_dir = "${dir}/downloads"\nsocket = "${dir}/ipx.sock"\nfetch_internal = ["127.0.0.1"]\n`);
|
||||
const env = { ...process.env, IPX_CONFIG: path.join(dir, 'config.toml'), IPX_DATA_DIR: path.join(dir, 'data') };
|
||||
const cli = (args: string[]) => execFileSync(setup.IPX_BIN, args, { env, encoding: 'utf8' });
|
||||
const ipx = (args: string[], input = '') => execFileSync(setup.IPX_BIN, ['user', ...args], { env, input, encoding: 'utf8' });
|
||||
const fails = (args: string[], input = '') => { try { ipx(args, input); } catch (e) { return said(e); } throw new Error(`${args} succeeded`); };
|
||||
|
||||
@@ -1156,6 +1159,11 @@ test('ipxd user adds, lists, renames and removes accounts, and says what is wron
|
||||
expect(ipx(['rm', 'bea'])).toBe('removed bea\n');
|
||||
expect(fails(['rm', 'bea'])).toContain('no such account: bea');
|
||||
expect(ipx(['list'])).not.toContain('bea');
|
||||
|
||||
// ipxd list: the feeds, each with its id on a line of its own.
|
||||
expect(cli(['list'])).toContain('No feeds configured');
|
||||
cli(['add', 'http://127.0.0.1:8792/cli.xml']);
|
||||
expect(cli(['list'])).toMatch(/^ {4}id {11}\S+\n {4}url {10}http:\/\/127\.0\.0\.1:8792\/cli\.xml\n {4}last checked never$/m);
|
||||
});
|
||||
|
||||
test('ipxd import subscribes the admin, and ipxd export writes the feeds out', async () => {
|
||||
|
||||
Reference in New Issue
Block a user