0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-12 05:02:14 +08:00
discourse/plugins/discourse-events/test/javascripts/lib/livestream-utils-test.js
2026-07-24 16:39:27 +04:00

35 lines
1 KiB
JavaScript
Vendored

import { module, test } from "qunit";
import { eventHasLivestream } from "discourse/plugins/discourse-events/discourse/lib/livestream-utils";
module("Unit | Lib | livestream-utils", function () {
test("eventHasLivestream requires both the flag and a URL", function (assert) {
assert.true(
eventHasLivestream({
livestream: true,
livestreamUrl: "https://us06web.zoom.us/j/123456789",
}),
"flagged with a URL"
);
assert.false(
eventHasLivestream({ livestream: true, livestreamUrl: null }),
"flagged without a URL"
);
assert.false(
eventHasLivestream({ livestream: true, livestreamUrl: "" }),
"flagged with a blank URL"
);
assert.false(
eventHasLivestream({
livestream: false,
livestreamUrl: "https://us06web.zoom.us/j/123456789",
}),
"unflagged with a URL"
);
});
test("eventHasLivestream handles a missing event", function (assert) {
assert.false(eventHasLivestream(null));
assert.false(eventHasLivestream(undefined));
});
});