0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-11 02:59:07 +08:00
discourse/plugins/discourse-calendar/test/javascripts/lib/livestream-utils-test.js
2026-07-10 15:50:46 +10:00

35 lines
1 KiB
JavaScript
Vendored

import { module, test } from "qunit";
import { eventHasLivestream } from "discourse/plugins/discourse-calendar/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));
});
});