mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 09:26:54 -06:00
DEV: Fix flaky search-full-page test (#14421)
This commit is contained in:
parent
c9e7b64a64
commit
e8182a133a
@ -20,15 +20,6 @@ acceptance("Search - Full Page", function (needs) {
|
||||
needs.user();
|
||||
needs.settings({ tagging_enabled: true });
|
||||
needs.pretender((server, helper) => {
|
||||
server.get("/tags/filter/search", () => {
|
||||
return helper.response({
|
||||
results: [
|
||||
{ text: "monkey", count: 1 },
|
||||
{ text: "gazelle", count: 2 },
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
server.get("/u/search/users", () => {
|
||||
return helper.response({
|
||||
users: [
|
||||
@ -530,7 +521,7 @@ acceptance("Search - Full Page", function (needs) {
|
||||
test("search for categories/tags", async function (assert) {
|
||||
await visit("/search");
|
||||
|
||||
await fillIn(".search-query", "monk");
|
||||
await fillIn(".search-query", "none");
|
||||
const typeSelector = selectKit(".search-bar .select-kit#search-type");
|
||||
|
||||
assert.ok(!exists(".fps-tag-item"), "has no category/tag results");
|
||||
@ -549,7 +540,7 @@ acceptance("Search - Full Page", function (needs) {
|
||||
exists(".search-filters"),
|
||||
"returning to topic/posts shows filters"
|
||||
);
|
||||
assert.ok(!exists(".user-item"), "has no user results");
|
||||
assert.ok(!exists(".fps-tag-item"), "has no tag results");
|
||||
});
|
||||
|
||||
test("filters expand/collapse as expected", async function (assert) {
|
||||
|
@ -134,7 +134,12 @@ export function applyDefaultHandlers(pretender) {
|
||||
pretender.delete("/bookmarks/:id", () => response({}));
|
||||
|
||||
pretender.get("/tags/filter/search", () => {
|
||||
return response({ results: [{ text: "monkey", count: 1 }] });
|
||||
return response({
|
||||
results: [
|
||||
{ text: "monkey", count: 1 },
|
||||
{ text: "gazelle", count: 2 },
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
pretender.get(`/u/:username/emails.json`, (request) => {
|
||||
|
@ -42,9 +42,15 @@ discourseModule(
|
||||
|
||||
await this.subject.expand();
|
||||
await this.subject.fillInFilter("mon");
|
||||
assert.equal(queryAll(".select-kit-row").text().trim(), "monkey x1");
|
||||
assert.equal(
|
||||
queryAll(".select-kit-row").text().trim(),
|
||||
"monkey x1\ngazelle x2"
|
||||
);
|
||||
await this.subject.fillInFilter("key");
|
||||
assert.equal(queryAll(".select-kit-row").text().trim(), "monkey x1");
|
||||
assert.equal(
|
||||
queryAll(".select-kit-row").text().trim(),
|
||||
"monkey x1\ngazelle x2"
|
||||
);
|
||||
await this.subject.selectRowByValue("monkey");
|
||||
|
||||
assert.equal(this.subject.header().value(), "foo,bar,monkey");
|
||||
|
Loading…
Reference in New Issue
Block a user