mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 08:09:33 +08:00
Add qunit test and fix the rspec method
This commit is contained in:
parent
f54052d796
commit
f38caf30fb
|
@ -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
|
||||
<p><span class="discourse-local-date" data-date="2018-05-08" data-time="22:00" data-format="LLL" data-timezones="Europe/Paris|America/Los_Angeles" data-email-preview="May 9, 2018 12:00 AM (Europe: Paris)">May 9, 2018 12:00 AM (Europe: Paris)</span></p>
|
||||
<p><span class="discourse-local-date" data-date="2018-05-08" data-format="LLL" data-timezones="Europe/Paris|America/Los_Angeles" data-time="22:00" data-email-preview="May 9, 2018 12:00 AM (Europe: Paris)">May 9, 2018 12:00 AM (Europe: Paris)</span></p>
|
||||
HTML
|
||||
|
||||
expect(PrettyText.format_for_email(cooked)).to match_html(cooked_mail)
|
||||
|
|
|
@ -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"
|
||||
);
|
||||
});
|
Loading…
Reference in New Issue
Block a user