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,8 +31,7 @@ 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",
@@ -41,8 +40,8 @@ run_test("filter_table", (override) => {
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",
@@ -51,8 +50,8 @@ run_test("filter_table", (override) => {
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",
@@ -61,8 +60,8 @@ run_test("filter_table", (override) => {
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++",
@@ -71,8 +70,8 @@ run_test("filter_table", (override) => {
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",
@@ -81,8 +80,9 @@ run_test("filter_table", (override) => {
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);