mirror of
https://github.com/hanzoai/forum.git
synced 2026-09-30 21:51:19 +00:00
31 lines
1.0 KiB
JavaScript
31 lines
1.0 KiB
JavaScript
import { click, render } from "@ember/test-helpers";
|
|
import { hbs } from "ember-cli-htmlbars";
|
|
import { module, test } from "qunit";
|
|
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
|
|
|
|
module("Integration | Component | d-navigation", function (hooks) {
|
|
setupRenderingTest(hooks);
|
|
|
|
hooks.beforeEach(function () {
|
|
const categories = this.site.categoriesList
|
|
.filter((category) => !category.parent_category_id)
|
|
.slice(0, 4);
|
|
this.site.setProperties({ categories });
|
|
|
|
this.currentUser.set(
|
|
"indirectly_muted_category_ids",
|
|
categories.slice(0, 3).map((category) => category.id)
|
|
);
|
|
});
|
|
|
|
test("filters indirectly muted categories", async function (assert) {
|
|
await render(hbs`<DNavigation @filterMode="categories" />`);
|
|
await click(".category-drop .select-kit-header-wrapper");
|
|
|
|
assert
|
|
.dom(".category-row")
|
|
.exists({ count: 1 }, "displays only categories that are not muted");
|
|
assert.dom(".category-row .badge-category span").hasText("dev");
|
|
});
|
|
});
|