FEATURE: support more views for category page on mobile

This commit is contained in:
Arpit Jalan 2024-12-25 20:48:36 +05:30
parent 4ccbf5c5ad
commit 80e6776304
2 changed files with 27 additions and 0 deletions

View File

@ -16,6 +16,9 @@ import { MAX_UNOPTIMIZED_CATEGORIES } from "discourse/lib/constants";
const mobileCompatibleViews = [
"categories_with_featured_topics",
"subcategories_with_featured_topics",
"categories_boxes",
"categories_boxes_with_topics",
"categories_only",
];
const subcategoryComponents = {

View File

@ -127,6 +127,30 @@ acceptance(
}
);
acceptance(
"Categories - 'categories_boxes_with_topics' (mobile)",
function (needs) {
needs.mobileView();
needs.settings({
desktop_category_page_style: "categories_boxes_with_topics",
});
test("basic functionality", async function (assert) {
await visit("/categories");
assert
.dom(
"div.category-box-inner .category-box-heading a.parent-box-link[href='/c/dev/7']"
)
.exists("shows boxes for top-level category");
assert
.dom(
"div.category-box-inner .featured-topics li[data-topic-id='11994']"
)
.exists("shows featured topics in boxes");
});
}
);
acceptance("Categories - preloadStore handling", function () {
const styles = [
"categories_only",