mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
node tests: Extract locals for stream names.
This just makes the next diff smaller. It makes sense on its own to just flatten the code.
This commit is contained in:
@@ -31,8 +31,7 @@ run_test("filter_table", (override) => {
|
||||
override(subs, "add_tooltips_to_left_panel", () => {});
|
||||
|
||||
// set-up sub rows stubs
|
||||
const sub_row_data = [
|
||||
{
|
||||
const denmark = {
|
||||
elem: "denmark",
|
||||
subscribed: false,
|
||||
name: "Denmark",
|
||||
@@ -41,8 +40,8 @@ run_test("filter_table", (override) => {
|
||||
subscribers: [1],
|
||||
stream_weekly_traffic: null,
|
||||
color: "red",
|
||||
},
|
||||
{
|
||||
};
|
||||
const poland = {
|
||||
elem: "poland",
|
||||
subscribed: true,
|
||||
name: "Poland",
|
||||
@@ -51,8 +50,8 @@ run_test("filter_table", (override) => {
|
||||
subscribers: [1, 2, 3],
|
||||
stream_weekly_traffic: 13,
|
||||
color: "red",
|
||||
},
|
||||
{
|
||||
};
|
||||
const pomona = {
|
||||
elem: "pomona",
|
||||
subscribed: true,
|
||||
name: "Pomona",
|
||||
@@ -61,8 +60,8 @@ run_test("filter_table", (override) => {
|
||||
subscribers: [],
|
||||
stream_weekly_traffic: 0,
|
||||
color: "red",
|
||||
},
|
||||
{
|
||||
};
|
||||
const cpp = {
|
||||
elem: "cpp",
|
||||
subscribed: true,
|
||||
name: "C++",
|
||||
@@ -71,8 +70,8 @@ run_test("filter_table", (override) => {
|
||||
subscribers: [1, 2],
|
||||
stream_weekly_traffic: 6,
|
||||
color: "red",
|
||||
},
|
||||
{
|
||||
};
|
||||
const zzyzx = {
|
||||
elem: "zzyzx",
|
||||
subscribed: true,
|
||||
name: "Zzyzx",
|
||||
@@ -81,8 +80,9 @@ run_test("filter_table", (override) => {
|
||||
subscribers: [1, 2],
|
||||
stream_weekly_traffic: 6,
|
||||
color: "red",
|
||||
},
|
||||
];
|
||||
};
|
||||
|
||||
const sub_row_data = [denmark, poland, pomona, cpp, zzyzx];
|
||||
|
||||
for (const sub of sub_row_data) {
|
||||
stream_data.create_sub_from_server_data(sub);
|
||||
|
||||
Reference in New Issue
Block a user