fix(llc): handle channel mute expiration.

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2023-06-19 14:08:04 +05:30
committed by xsahil03x
parent d3623ed4c2
commit 5db41595e2
2 changed files with 42 additions and 0 deletions
@@ -2481,6 +2481,31 @@ void main() {
)).called(1);
});
test('`.mute with expiration`', () async {
const expiration = Duration(seconds: 3);
when(() => client.muteChannel(
channelCid,
expiration: expiration,
)).thenAnswer((_) async => EmptyResponse());
when(() => client.unmuteChannel(channelCid))
.thenAnswer((_) async => EmptyResponse());
final res = await channel.mute(expiration: expiration);
expect(res, isNotNull);
verify(() => client.muteChannel(
channelCid,
expiration: expiration,
)).called(1);
// wait for expiration
await Future.delayed(expiration);
verify(() => client.unmuteChannel(channelCid)).called(1);
});
test('`.unmute`', () async {
when(
() => client.unmuteChannel(channelCid),