From bce00181632b50670989a443f8ae7961805a8083 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Thu, 19 Dec 2024 12:05:39 +0100 Subject: [PATCH] DEV: correctly applies identifier do DModal used in DMenu (#30370) A previous refactor used an incorrect path. This commit also adds a simple test to ensure this identifier is present. --- .../tests/integration/components/float-kit/d-menu-test.js | 4 ++-- app/assets/javascripts/float-kit/addon/components/d-menu.gjs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/tests/integration/components/float-kit/d-menu-test.js b/app/assets/javascripts/discourse/tests/integration/components/float-kit/d-menu-test.js index 685adc00ba4..7fdc9c2e7d1 100644 --- a/app/assets/javascripts/discourse/tests/integration/components/float-kit/d-menu-test.js +++ b/app/assets/javascripts/discourse/tests/integration/components/float-kit/d-menu-test.js @@ -47,11 +47,11 @@ module("Integration | Component | FloatKit | d-menu", function (hooks) { this.site.mobileView = true; await render( - hbs`` + hbs`` ); await open(); - assert.dom(".fk-d-menu-modal").hasText("content"); + assert.dom(".fk-d-menu-modal[data-identifier='foo']").hasText("content"); }); test("@onRegisterApi", async function (assert) { diff --git a/app/assets/javascripts/float-kit/addon/components/d-menu.gjs b/app/assets/javascripts/float-kit/addon/components/d-menu.gjs index 15572940e71..77861063115 100644 --- a/app/assets/javascripts/float-kit/addon/components/d-menu.gjs +++ b/app/assets/javascripts/float-kit/addon/components/d-menu.gjs @@ -119,7 +119,7 @@ export default class DMenu extends Component { @class }} @inline={{(isTesting)}} - data-identifier={{@instance.options.identifier}} + data-identifier={{this.options.identifier}} data-content >