diff --git a/plugins/discourse-local-dates/spec/lib/pretty_text_spec.rb b/plugins/discourse-local-dates/spec/lib/pretty_text_spec.rb index 9532861ffb6..617753415f5 100644 --- a/plugins/discourse-local-dates/spec/lib/pretty_text_spec.rb +++ b/plugins/discourse-local-dates/spec/lib/pretty_text_spec.rb @@ -7,7 +7,7 @@ describe PrettyText do [date=2018-05-08 time=22:00 format=LLL timezones="Europe/Paris|America/Los_Angeles"] MD cooked_mail = <<~HTML -
May 9, 2018 12:00 AM (Europe: Paris)
+May 9, 2018 12:00 AM (Europe: Paris)
HTML expect(PrettyText.format_for_email(cooked)).to match_html(cooked_mail) diff --git a/plugins/discourse-local-dates/test/javascripts/acceptance/local-dates-test.js.es6 b/plugins/discourse-local-dates/test/javascripts/acceptance/local-dates-test.js.es6 new file mode 100644 index 00000000000..b98262b41be --- /dev/null +++ b/plugins/discourse-local-dates/test/javascripts/acceptance/local-dates-test.js.es6 @@ -0,0 +1,25 @@ +import { acceptance } from "helpers/qunit-helpers"; +import { clearPopupMenuOptionsCallback } from "discourse/controllers/composer"; + +acceptance("Local Dates", { + loggedIn: true, + settings: { discourse_local_dates_enabled: true }, + beforeEach() { + clearPopupMenuOptionsCallback(); + } +}); + +test("local dates bbcode", async assert => { + await visit("/"); + await click("#create-topic"); + + await fillIn( + ".d-editor-input", + '[date=2017-10-23 time=01:30:00 format="LL" timezone="Asia/Calcutta" timezones="Europe/Paris|America/Los_Angeles"]' + ); + + assert.ok( + exists(".d-editor-preview .discourse-local-date.past.cooked-date"), + "it should contain the cooked date output" + ); +});