feat(social): standard NIP-56 reporting — ReportTransport in commons_core, report sheet on offers and chats, local hide + optional block
This commit is contained in:
parent
11b242edbf
commit
0e7faaeb90
15 changed files with 560 additions and 15 deletions
|
|
@ -220,6 +220,28 @@ void main() {
|
|||
await cubit.close();
|
||||
});
|
||||
|
||||
test('a hidden (reported) offer disappears without touching its author',
|
||||
() async {
|
||||
final transport = FakeOfferTransport();
|
||||
for (final id in ['lot-1', 'lot-2']) {
|
||||
await transport.publish(OfferMapper.fromSharedLot(
|
||||
lotId: id,
|
||||
authorPubkeyHex: 'ab' * 32,
|
||||
summary: 'Oferta $id',
|
||||
sharing: OfferStatus.shared,
|
||||
areaGeohash: 'sp3e9',
|
||||
));
|
||||
}
|
||||
final cubit = OffersCubit(transport);
|
||||
await cubit.discover('sp3');
|
||||
await pumpEventQueue();
|
||||
expect(cubit.state.visibleOffers, hasLength(2));
|
||||
|
||||
cubit.setHiddenOffers({'${'ab' * 32}:lot-1'});
|
||||
expect(cubit.state.visibleOffers.map((o) => o.id), ['lot-2']);
|
||||
await cubit.close();
|
||||
});
|
||||
|
||||
test('the search filter survives a refresh (re-discovery)', () async {
|
||||
final transport = FakeOfferTransport();
|
||||
await transport.publish(OfferMapper.fromSharedLot(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue