DEV: Include helper in core for applyLocalDates (#16325)

This commit is contained in:
Penar Musaraj
2022-03-30 20:58:38 -04:00
committed by GitHub
parent 57b20393ac
commit 943083f4df
5 changed files with 52 additions and 17 deletions

View File

@ -1,6 +1,11 @@
import { acceptance, queryAll } from "discourse/tests/helpers/qunit-helpers";
import {
acceptance,
query,
queryAll,
} from "discourse/tests/helpers/qunit-helpers";
import { test } from "qunit";
import { click, fillIn, visit } from "@ember/test-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper";
acceptance("Local Dates - composer", function (needs) {
needs.user();
@ -61,4 +66,19 @@ acceptance("Local Dates - composer", function (needs) {
);
assert.notOk(getAttr("time"), "it doesn’t have time");
});
test("date modal", async function (assert) {
await visit("/");
await click("#create-topic");
await click(".d-editor-button-bar .local-dates");
const timezoneChooser = selectKit(".timezone-input");
await timezoneChooser.expand();
await timezoneChooser.selectRowByValue("Asia/Macau");
assert.ok(
query(".preview .discourse-local-date").textContent.includes("Macau"),
"it outputs a preview date in selected timezone"
);
});
});