compose: Add subscribe button to the not subscribed stream error message.

Before that, we needed to go the stream settings to subscribe to a
particular stream.

Fixes #3877.
This commit is contained in:
Balaji2198
2018-04-04 23:08:09 +05:30
committed by Tim Abbott
parent d3627ab419
commit 605916f6d7
6 changed files with 64 additions and 6 deletions

View File

@@ -101,8 +101,12 @@ people.add(bob);
sub.subscribed = false;
stream_data.add_sub('social', sub);
templates.render = function (template_name) {
assert.equal(template_name, 'compose_not_subscribed');
return 'compose_not_subscribed_stub';
};
assert(!compose.validate_stream_message_address_info('social'));
assert.equal($('#compose-error-msg').html(), "translated: <p>You're not subscribed to the stream <b>social</b>.</p><p>Manage your subscriptions <a href='#streams/all'>on your Streams page</a>.</p>");
assert.equal($('#compose-error-msg').html(), 'compose_not_subscribed_stub');
global.page_params.narrow_stream = false;
channel.post = function (payload) {
@@ -121,7 +125,7 @@ people.add(bob);
payload.success(payload.data);
};
assert(!compose.validate_stream_message_address_info('Frontend'));
assert.equal($('#compose-error-msg').html(), "translated: <p>You're not subscribed to the stream <b>Frontend</b>.</p><p>Manage your subscriptions <a href='#streams/all'>on your Streams page</a>.</p>");
assert.equal($('#compose-error-msg').html(), 'compose_not_subscribed_stub');
channel.post = function (payload) {
assert.equal(payload.data.stream, 'Frontend');