FIX: ensures category url of category drop is built using slug and id (#9069)

This commit is contained in:
Joffrey JAFFEUX
2020-02-28 17:58:22 +01:00
committed by GitHub
parent ff5ff8d0d2
commit 2db8ada222
2 changed files with 25 additions and 7 deletions

View File

@ -1,3 +1,4 @@
import DiscourseURL from "discourse/lib/url";
import Category from "discourse/models/category";
import componentTest from "helpers/component-test";
import { testSelectKitModule } from "./select-kit-test-helper";
@ -335,3 +336,22 @@ componentTest(
}
}
);
componentTest("category url", {
template: template(),
beforeEach() {
initCategoriesWithParentCategory(this);
sandbox.stub(DiscourseURL, "routeTo");
},
async test(assert) {
await this.subject.expand();
await this.subject.selectRowByValue(26);
assert.ok(
DiscourseURL.routeTo.calledWith("/c/feature/spec/26"),
"it builds a correct URL"
);
}
});