From 60b16a92e3c3dd3ff506af60b44127a4614cb557 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Sun, 16 Aug 2020 15:17:46 +0000 Subject: [PATCH] node tests: Add has_zoom_token to event.fixtures. --- frontend_tests/node_tests/compose.js | 10 ++++++---- frontend_tests/node_tests/lib/events.js | 5 +++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/frontend_tests/node_tests/compose.js b/frontend_tests/node_tests/compose.js index b818651650..278dbfba51 100644 --- a/frontend_tests/node_tests/compose.js +++ b/frontend_tests/node_tests/compose.js @@ -3,6 +3,8 @@ const {JSDOM} = require("jsdom"); const rewiremock = require("rewiremock/node"); +const events = require("./lib/events.js"); + set_global("bridge", false); const noop = function () {}; @@ -1495,10 +1497,10 @@ run_test("on_events", () => { window.open = function (url) { assert(url.endsWith("/calls/zoom/register")); - server_events_dispatch.dispatch_normal_event({ - type: "has_zoom_token", - value: true, - }); + + // The event here has value=true. We keep it in events.js to + // allow our tooling to verify its schema. + server_events_dispatch.dispatch_normal_event(events.fixtures.has_zoom_token); }; channel.post = function (payload) { diff --git a/frontend_tests/node_tests/lib/events.js b/frontend_tests/node_tests/lib/events.js index 95755a17f4..b5d30e8048 100644 --- a/frontend_tests/node_tests/lib/events.js +++ b/frontend_tests/node_tests/lib/events.js @@ -131,6 +131,11 @@ exports.fixtures = { topic: "topic1", }, + has_zoom_token: { + type: "has_zoom_token", + value: true, + }, + hotspots: { type: "hotspots", hotspots: [