FIX: correctly display label (#31282)

A regression introduced in 32c8aa0aad880bcab372ffd75bce3c857060d721
incorrectly passes label to the trigger component, but also passes
translatedLabel instead of label to the menu.

The existing test was checking for the presence of "label", but it was
actually returning true because the test was showing "en.label". The
test has been modified in consequences.
This commit is contained in:
Joffrey JAFFEUX 2025-02-11 20:11:04 +01:00 committed by GitHub
parent 4db3389f3d
commit 24b2e353a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 5 deletions

View File

@ -25,7 +25,7 @@ module("Integration | Component | FloatKit | d-menu", function (hooks) {
test("@label", async function (assert) {
await render(hbs`<DMenu @inline={{true}} @label="label" />`);
assert.dom(".fk-d-menu__trigger").containsText("label");
assert.dom(".fk-d-menu__trigger .d-button-label").hasText(/^label$/);
});
test("@icon", async function (assert) {

View File

@ -85,11 +85,8 @@ export default class DMenu extends Component {
get icon() {
return instance.args.icon;
},
get label() {
return instance.args.label;
},
get translatedLabel() {
return instance.args.translatedLabel;
return instance.args.label;
},
get translatedAriaLabel() {
return instance.args.ariaLabel;