feat: bookmark the site directory on a first start

This commit is contained in:
randogoth 2026-10-11 22:58:02 +03:00
parent 95602ac623
commit dcb70a93d1
14 changed files with 506 additions and 1 deletions

View file

@ -193,6 +193,24 @@ void main() {
expect((await db.allPins())['capsule.example:1965'], renewed);
});
test('the directory bookmark is given once and removal keeps it removed',
() async {
// A fresh install has nothing.
expect(await db.directorySeeded(), isFalse);
// The first start gives the directory of sites.
await db.seedDirectoryBookmark('https://mews.page/directory', 'Mews directory');
expect(await db.countBookmarks(), 1);
expect((await db.allBookmarks()).single.title, 'Mews directory');
expect(await db.directorySeeded(), isTrue);
// Starting again adds nothing, and the reader's removal of it is not
// undone by any later start.
await db.removeBookmark('https://mews.page/directory');
await db.seedDirectoryBookmark('https://mews.page/directory', 'Mews directory');
expect(await db.countBookmarks(), 0);
});
test('bindings tie identities to hosts and follow the identity out', () async {
final id = await db.addClientCertificate('Reader', 'CERT PEM');
await db.bindCertificate('capsule.example', 1965, id);