mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-28 05:14:21 +08:00
This commit makes the following changes: - uses fullcalendar 6 - replaces the server generated upcoming dates for recurring events with a frontend implementation of the RRULE standard (using the fullcalendar RRULE plugin) - displays a preview of the event on click on the upcoming events calendar --------- Co-authored-by: chapoi <101828855+chapoi@users.noreply.github.com> Co-authored-by: Martin Brennan <martin@discourse.org>
52 lines
1.4 KiB
JavaScript
Vendored
52 lines
1.4 KiB
JavaScript
Vendored
import { visit } from "@ember/test-helpers";
|
|
import { test } from "qunit";
|
|
import { cloneJSON } from "discourse/lib/object";
|
|
import { acceptance, fakeTime } from "discourse/tests/helpers/qunit-helpers";
|
|
import eventTopicFixture from "../helpers/event-topic-fixture";
|
|
|
|
acceptance("Discourse Calendar - Topic Calendar Holidays", function (needs) {
|
|
needs.hooks.beforeEach(function () {
|
|
this.clock = fakeTime("2023-12-10T00:00:00", "America/Los_Angeles", true);
|
|
});
|
|
|
|
needs.hooks.afterEach(function () {
|
|
this.clock.restore();
|
|
});
|
|
|
|
needs.settings({
|
|
calendar_enabled: true,
|
|
});
|
|
|
|
needs.pretender((server, helper) => {
|
|
const clonedEventTopicFixture = cloneJSON(eventTopicFixture);
|
|
|
|
clonedEventTopicFixture.post_stream.posts[0].calendar_details = [
|
|
{
|
|
type: "grouped",
|
|
from: "2023-12-25T05:00:00.000Z",
|
|
timezone: "Europe/Rome",
|
|
name: "Natale",
|
|
users: [
|
|
{
|
|
username: "gmt+1_user",
|
|
timezone: "Europe/Rome",
|
|
},
|
|
],
|
|
},
|
|
];
|
|
server.get("/t/252.json", () => {
|
|
return helper.response(clonedEventTopicFixture);
|
|
});
|
|
});
|
|
|
|
test("renders calendar holidays with fullDay='true'", async (assert) => {
|
|
await visit("/t/-/252");
|
|
|
|
assert
|
|
.dom(".fc-daygrid-body tr:nth-of-type(5) .fc-event-title")
|
|
.hasText(
|
|
"gmt+1_user",
|
|
"Italian Christmas Day is displayed on Monday 2023-12-25"
|
|
);
|
|
});
|
|
});
|