DEV: removes hidden-details component (#27833)

Not used anywhere
This commit is contained in:
Joffrey JAFFEUX 2024-07-10 16:05:45 +02:00 committed by GitHub
parent 322db8adb5
commit 67c3f29486
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 0 additions and 44 deletions

View File

@ -1,6 +0,0 @@
{{#unless this.expanded}}
<DButton @action={{this.expand}} @label={{this.label}} class="btn-link" />
{{/unless}}
{{#if this.expanded}}
<span class="description" aria-live="assertive">{{this.details}}</span>
{{/if}}

View File

@ -1,9 +0,0 @@
import Component from "@ember/component";
import { action } from "@ember/object";
export default Component.extend({
@action
expand() {
this.set("expanded", true);
},
});

View File

@ -1,29 +0,0 @@
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";
import { exists, query } from "discourse/tests/helpers/qunit-helpers";
import I18n from "discourse-i18n";
module("Integration | Component | hidden-details", function (hooks) {
setupRenderingTest(hooks);
test("Shows a link and turns link into details on click", async function (assert) {
this.set("label", "label");
this.set("details", "details");
await render(
hbs`<HiddenDetails @label={{this.label}} @details={{this.details}} />`
);
assert.ok(exists(".btn-link"));
assert.strictEqual(query(".btn-link span").innerText, I18n.t("label"));
assert.notOk(exists(".description"));
await click(".btn-link");
assert.notOk(exists(".btn-link"));
assert.ok(exists(".description"));
assert.strictEqual(query(".description").innerText, "details");
});
});