DEV: Unsilence d-section deprecation (#29851)

This commit is contained in:
David Taylor 2024-11-20 15:27:19 +00:00 committed by GitHub
parent 6f7c581a80
commit daa34b9e11
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 7 deletions

View File

@ -4,7 +4,6 @@ const DEPRECATION_WORKFLOW = [
matchId: "ember-this-fallback.this-property-fallback", matchId: "ember-this-fallback.this-property-fallback",
}, },
{ handler: "silence", matchId: "discourse.select-kit" }, { handler: "silence", matchId: "discourse.select-kit" },
{ handler: "silence", matchId: "discourse.d-section" },
{ {
handler: "silence", handler: "silence",
matchId: "discourse.decorate-widget.hamburger-widget-links", matchId: "discourse.decorate-widget.hamburger-widget-links",

View File

@ -1,4 +1,4 @@
<DSection @pageClass="user-preferences-tracking" /> {{body-class "user-preferences-tracking-page"}}
<div class="user-preferences__tracking-topics-wrapper"> <div class="user-preferences__tracking-topics-wrapper">
<label class="control-label">{{i18n "user.topics_settings"}}</label> <label class="control-label">{{i18n "user.topics_settings"}}</label>

View File

@ -2,16 +2,19 @@ import { render } from "@ember/test-helpers";
import { module, test } from "qunit"; import { module, test } from "qunit";
import DSection from "discourse/components/d-section"; import DSection from "discourse/components/d-section";
import { setupRenderingTest } from "discourse/tests/helpers/component-test"; import { setupRenderingTest } from "discourse/tests/helpers/component-test";
import { withSilencedDeprecationsAsync } from "discourse-common/lib/deprecated";
module("Integration | Component | d-section", function (hooks) { module("Integration | Component | d-section", function (hooks) {
setupRenderingTest(hooks); setupRenderingTest(hooks);
test("can set classes on the body element", async function (assert) { test("can set classes on the body element", async function (assert) {
await render(<template> await withSilencedDeprecationsAsync("discourse.d-section", async () => {
<DSection @pageClass="test" @bodyClass="foo bar" class="special"> await render(<template>
testing! <DSection @pageClass="test" @bodyClass="foo bar" class="special">
</DSection> testing!
</template>); </DSection>
</template>);
});
assert.dom(".special").hasText("testing!"); assert.dom(".special").hasText("testing!");
assert.strictEqual(document.body.className, "test-page foo bar"); assert.strictEqual(document.body.className, "test-page foo bar");