FIX: Don't add the no-text class if translatedLabel is present (#22111)
This commit is contained in:
parent
9e20fcb9c1
commit
1865eb1de3
|
@ -10,7 +10,7 @@ export const ButtonClass = {
|
|||
buildClasses(attrs) {
|
||||
let className = this.attrs.className || "";
|
||||
|
||||
let hasText = attrs.label || attrs.contents;
|
||||
let hasText = attrs.translatedLabel || attrs.label || attrs.contents;
|
||||
|
||||
if (!hasText) {
|
||||
className += " no-text";
|
||||
|
|
|
@ -63,4 +63,12 @@ module("Integration | Component | Widget | button", function (hooks) {
|
|||
|
||||
assert.strictEqual(query("button").title, "foo bar");
|
||||
});
|
||||
|
||||
test("translatedLabel skips no-text class in icon", async function (assert) {
|
||||
this.set("args", { icon: "plus", translatedLabel: "foo bar" });
|
||||
|
||||
await render(hbs`<MountWidget @widget="button" @args={{this.args}} />`);
|
||||
|
||||
assert.ok(!exists("button.btn.btn-icon.no-text"), "skips no-text class");
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue