Skip to content

Commit

Permalink
Add test for LiveObjects state modes
Browse files Browse the repository at this point in the history
  • Loading branch information
VeskeR committed Oct 18, 2024
1 parent 4254945 commit 42c9d5c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/realtime/live_objects.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,5 +446,22 @@ define(['ably', 'shared_helper', 'chai', 'live_objects', 'live_objects_helper'],
}, client);
});
});

it('can attach to channel with LiveObjects state modes', async function () {
const helper = this.test.helper;
const client = helper.AblyRealtime();

await helper.monitorConnectionThenCloseAndFinish(async () => {
const liveObjectsModes = ['state_subscribe', 'state_publish'];
const channelOptions = { modes: liveObjectsModes };
const channel = client.channels.get('channel', channelOptions);

await channel.attach();

helper.recordPrivateApi('read.channel.channelOptions');
expect(channel.channelOptions).to.deep.equal(channelOptions, 'Check expected channel options');
expect(channel.modes).to.deep.equal(liveObjectsModes, 'Check expected modes');
}, client);
});
});
});

0 comments on commit 42c9d5c

Please sign in to comment.