settings_profile_fields: Fix sortablejs import.

Commit 114cc1ec25 (#15949) introduced a
subtle bug because sortablejs provides both a CJS module and an ES
module that expose different interfaces to CJS require() under
Webpack.  This difference will disappear when we convert
settings_profile_fields to an ES module.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2020-07-31 20:07:27 -07:00
parent 6e84e49079
commit 59ba7e38c0
2 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@ page_params.custom_profile_field_types = {
};
rewiremock.proxy(() => zrequire("settings_profile_fields"), {
sortablejs: {create: () => {}},
sortablejs: {default: {create: () => {}}},
});
function test_populate(opts) {

View File

@ -1,4 +1,4 @@
const Sortable = require("sortablejs");
const Sortable = require("sortablejs").default;
const render_admin_profile_field_list = require("../templates/admin_profile_field_list.hbs");
const render_settings_profile_field_choice = require("../templates/settings/profile_field_choice.hbs");