From 3a4d13fe83c7fda5087e4a8ea42125e67a114b9d Mon Sep 17 00:00:00 2001 From: evgeny Date: Fri, 2 Feb 2024 21:04:01 +0000 Subject: [PATCH] WIP: check on attaching --- test/realtime/channel.test.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/realtime/channel.test.js b/test/realtime/channel.test.js index a079b64062..8cb1ce209f 100644 --- a/test/realtime/channel.test.js +++ b/test/realtime/channel.test.js @@ -1684,5 +1684,20 @@ define(['ably', 'shared_helper', 'async', 'chai'], function (Ably, helper, async }); }); }); + + it('should not throw exception then run RealtimeChannels.get() with same options', function (done) { + const realtime = helper.AblyRealtime(); + const channel = realtime.channels.get('channel-with-options', { mode: ['PRESENCE'] }); + channel.attach(); + channel.whenState('attaching', function () { + try { + realtime.channels.get('channel-with-options', { mode: ['PRESENCE'] }); + closeAndFinish(done, realtime); + } catch (err) { + closeAndFinish(done, realtime, err); + } + }); + }); + }); });