mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
UX: allow anon users to download calendar (#29551)
Allows anonymous users to download the calendar file. Before, they were given the option, but it would fail silently with a `TypeError: Cannot read properties of null (reading 'user_option')`.
This commit is contained in:
@ -33,6 +33,40 @@ acceptance(
|
||||
I18n.t("download_calendar.title"),
|
||||
"it should display modal to select calendar"
|
||||
);
|
||||
|
||||
assert.dom(".control-group.remember").exists();
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
acceptance(
|
||||
"Local Dates - Download calendar as an anonymous user",
|
||||
function (needs) {
|
||||
needs.settings({ discourse_local_dates_enabled: true });
|
||||
needs.pretender((server, helper) => {
|
||||
const response = cloneJSON(fixturesByUrl["/t/281.json"]);
|
||||
const startDate = moment
|
||||
.tz("America/Lima")
|
||||
.add(1, "days")
|
||||
.format("YYYY-MM-DD");
|
||||
response.post_stream.posts[0].cooked = `<p><span data-date=\"${startDate}\" data-time=\"13:00:00\" class=\"discourse-local-date\" data-timezone=\"America/Lima\" data-email-preview=\"${startDate}T18:00:00Z UTC\">${startDate}T18:00:00Z</span></p>`;
|
||||
|
||||
server.get("/t/281.json", () => helper.response(response));
|
||||
});
|
||||
|
||||
test("Display pick calendar modal", async function (assert) {
|
||||
await visit("/t/local-dates/281");
|
||||
await click(".discourse-local-date");
|
||||
await click(".download-calendar");
|
||||
|
||||
assert
|
||||
.dom("#discourse-modal-title")
|
||||
.hasText(
|
||||
I18n.t("download_calendar.title"),
|
||||
"it should display modal to select calendar"
|
||||
);
|
||||
|
||||
assert.dom(".control-group.remember").doesNotExist();
|
||||
});
|
||||
}
|
||||
);
|
||||
|
Reference in New Issue
Block a user