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.
This commit is contained in:
Joffrey JAFFEUX 2024-12-19 12:05:39 +01:00 committed by GitHub
parent 0a9ebbe1dd
commit bce0018163
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -47,11 +47,11 @@ module("Integration | Component | FloatKit | d-menu", function (hooks) {
this.site.mobileView = true; this.site.mobileView = true;
await render( await render(
hbs`<DMenu @inline={{true}} @modalForMobile={{true}} @content="content" />` hbs`<DMenu @identifier="foo" @inline={{true}} @modalForMobile={{true}} @content="content" />`
); );
await open(); 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) { test("@onRegisterApi", async function (assert) {

View File

@ -119,7 +119,7 @@ export default class DMenu extends Component {
@class @class
}} }}
@inline={{(isTesting)}} @inline={{(isTesting)}}
data-identifier={{@instance.options.identifier}} data-identifier={{this.options.identifier}}
data-content data-content
> >
<div class="fk-d-menu-modal__grip" aria-hidden="true"></div> <div class="fk-d-menu-modal__grip" aria-hidden="true"></div>