custom profile fields: Pass value as part of a dictionary.

While we're at it, we remove the JSON parsing that was part of the
user field code path, since this function isn't responsible for
rendering user fields.
This commit is contained in:
Hemanth V. Alluri
2018-12-31 11:11:06 +05:30
committed by Tim Abbott
parent bdaeccbca1
commit 28d344b4b5
8 changed files with 38 additions and 22 deletions

View File

@@ -591,7 +591,7 @@ run_test('compose_private_stream_alert', () => {
run_test('custom_user_profile_field', () => {
var field = {name: "GitHub user name", id: 2, hint: "Or link to profile"};
var args = {field: field, field_value: "@GitHub", field_type: "text"};
var args = {field: field, field_value: {value: "@GitHub"}, field_type: "text"};
var html = render('custom-user-profile-field', args);
assert.equal($(html).attr('data-field-id'), 2);
assert.equal($(html).find('.custom_user_field_value').val(), "@GitHub");