FIX: Ensure local date format shortcuts work correctly (#18541)

Followup to 03b7b7d1bc
This commit is contained in:
David Taylor 2022-10-11 11:25:32 +01:00 committed by GitHub
parent 36f7fbebdc
commit a0eb8092f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -309,7 +309,7 @@ export default Component.extend({
@action
updateFormat(format, event) {
event?.preventDefault();
this.format = format;
this.set("format", format);
},
actions: {

View File

@ -9,7 +9,10 @@ import selectKit from "discourse/tests/helpers/select-kit-helper";
acceptance("Local Dates - composer", function (needs) {
needs.user();
needs.settings({ discourse_local_dates_enabled: true });
needs.settings({
discourse_local_dates_enabled: true,
discourse_local_dates_default_formats: "LLL|LTS|LL|LLLL",
});
test("composer bbcode", async function (assert) {
const getAttr = (attr) => {
@ -121,5 +124,11 @@ acceptance("Local Dates - composer", function (needs) {
query(".pika-table .is-selected"),
"deleting selected TO date works"
);
await click(".advanced-mode-btn");
assert.strictEqual(query("input.format-input").value, "");
await click("ul.formats a.moment-format");
assert.strictEqual(query("input.format-input").value, "LLL");
});
});