This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/tests/integration/components/sidebar/section-link-test.js
Alan Guo Xiang Tan 5990842dd9 UX: Revamp styling of sidebar
The following changes are made in this commit:

1. Move caret icon in sidebar section header to the right.
1. Each row in sidebar takes the full width which enables us to do a
full width highlight on hover and when sidebar link is active.
1. Ensure each row in Sidebar is of the same height.

Internal refs: /t/70546, /t/72196, /t/71820
2022-08-18 16:14:49 +08:00

36 lines
1.2 KiB
JavaScript

import { module, test } from "qunit";
import { hbs } from "ember-cli-htmlbars";
import { render } from "@ember/test-helpers";
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
import { query } from "discourse/tests/helpers/qunit-helpers";
module("Integration | Component | sidebar | section-link", function (hooks) {
setupRenderingTest(hooks);
test("default class attribute for link", async function (assert) {
const template = hbs`<Sidebar::SectionLink @linkName="test" @route="discovery.latest" />`;
await render(template);
assert.strictEqual(
query("a").className,
"sidebar-section-link sidebar-section-link-test sidebar-row ember-view",
"has the right class attribute for the link"
);
});
test("custom class attribute for link", async function (assert) {
const template = hbs`<Sidebar::SectionLink @linkName="test" @route="discovery.latest" @class="123 abc" />`;
await render(template);
assert.strictEqual(
query("a").className,
"sidebar-section-link sidebar-section-link-test sidebar-row 123 abc ember-view",
"has the right class attribute for the link"
);
});
});