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:
Steve Howell
2021-02-16 14:57:10 +00:00
committed by Tim Abbott
parent 0e4ba368e0
commit dad90fe770

View File

@@ -31,58 +31,58 @@ run_test("filter_table", (override) => {
override(subs, "add_tooltips_to_left_panel", () => {}); override(subs, "add_tooltips_to_left_panel", () => {});
// set-up sub rows stubs // set-up sub rows stubs
const sub_row_data = [ const denmark = {
{ elem: "denmark",
elem: "denmark", subscribed: false,
subscribed: false, name: "Denmark",
name: "Denmark", stream_id: denmark_stream_id,
stream_id: denmark_stream_id, description: "Copenhagen",
description: "Copenhagen", subscribers: [1],
subscribers: [1], stream_weekly_traffic: null,
stream_weekly_traffic: null, color: "red",
color: "red", };
}, const poland = {
{ elem: "poland",
elem: "poland", subscribed: true,
subscribed: true, name: "Poland",
name: "Poland", stream_id: 102,
stream_id: 102, description: "monday",
description: "monday", subscribers: [1, 2, 3],
subscribers: [1, 2, 3], stream_weekly_traffic: 13,
stream_weekly_traffic: 13, color: "red",
color: "red", };
}, const pomona = {
{ elem: "pomona",
elem: "pomona", subscribed: true,
subscribed: true, name: "Pomona",
name: "Pomona", stream_id: 103,
stream_id: 103, description: "college",
description: "college", subscribers: [],
subscribers: [], stream_weekly_traffic: 0,
stream_weekly_traffic: 0, color: "red",
color: "red", };
}, const cpp = {
{ elem: "cpp",
elem: "cpp", subscribed: true,
subscribed: true, name: "C++",
name: "C++", stream_id: 104,
stream_id: 104, description: "programming lang",
description: "programming lang", subscribers: [1, 2],
subscribers: [1, 2], stream_weekly_traffic: 6,
stream_weekly_traffic: 6, color: "red",
color: "red", };
}, const zzyzx = {
{ elem: "zzyzx",
elem: "zzyzx", subscribed: true,
subscribed: true, name: "Zzyzx",
name: "Zzyzx", stream_id: 105,
stream_id: 105, description: "california town",
description: "california town", subscribers: [1, 2],
subscribers: [1, 2], stream_weekly_traffic: 6,
stream_weekly_traffic: 6, color: "red",
color: "red", };
},
]; const sub_row_data = [denmark, poland, pomona, cpp, zzyzx];
for (const sub of sub_row_data) { for (const sub of sub_row_data) {
stream_data.create_sub_from_server_data(sub); stream_data.create_sub_from_server_data(sub);