mirror of
https://github.com/hanzoai/forum.git
synced 2026-09-30 21:51:19 +00:00
Followup to 5eeb3623a9
1. Update a second regex in `routeTo` to avoid stripping domain/protocol from middle of string
2. Update `URL.handleURL` to strip double-slashes in paths, before calling the ember router. This mimics what Ember does on initial page-load
Additional tests are added for both
20 lines
557 B
JavaScript
20 lines
557 B
JavaScript
import { currentURL, settled, visit } from "@ember/test-helpers";
|
|
import { test } from "qunit";
|
|
import DiscourseURL from "discourse/lib/url";
|
|
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
|
|
|
|
acceptance("DiscourseURL", function () {
|
|
test("handleURL strips multiple slashes", async function (assert) {
|
|
await visit("/");
|
|
|
|
DiscourseURL.handleURL("/t//280");
|
|
await settled();
|
|
|
|
assert.strictEqual(
|
|
currentURL(),
|
|
"/t/internationalization-localization/280"
|
|
);
|
|
assert.dom("#topic-title").exists();
|
|
});
|
|
});
|