mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
Revert "DEV: allows to define an ariaLabel on d-button (#9716)"
This reverts commit 7a95dd48415c2152f1c791b2dfcd04f6910c1ca7.
This commit is contained in:
@ -100,75 +100,3 @@ componentTest("disabled button", {
|
||||
assert.ok(find("button:not([disabled])").length, "the button is enabled");
|
||||
}
|
||||
});
|
||||
|
||||
componentTest("aria-label", {
|
||||
template:
|
||||
"{{d-button ariaLabel=ariaLabel translatedAriaLabel=translatedAriaLabel}}",
|
||||
|
||||
beforeEach() {
|
||||
I18n.translations[I18n.locale].js.test = { fooAriaLabel: "foo" };
|
||||
},
|
||||
|
||||
test(assert) {
|
||||
this.set("ariaLabel", "test.fooAriaLabel");
|
||||
|
||||
assert.equal(
|
||||
find("button")[0].getAttribute("aria-label"),
|
||||
I18n.t("test.fooAriaLabel")
|
||||
);
|
||||
|
||||
this.setProperties({
|
||||
ariaLabel: null,
|
||||
translatedAriaLabel: "bar"
|
||||
});
|
||||
|
||||
assert.equal(find("button")[0].getAttribute("aria-label"), "bar");
|
||||
}
|
||||
});
|
||||
|
||||
componentTest("title", {
|
||||
template: "{{d-button title=title translatedTitle=translatedTitle}}",
|
||||
|
||||
beforeEach() {
|
||||
I18n.translations[I18n.locale].js.test = { fooTitle: "foo" };
|
||||
},
|
||||
|
||||
test(assert) {
|
||||
this.set("title", "test.fooTitle");
|
||||
assert.equal(
|
||||
find("button")[0].getAttribute("title"),
|
||||
I18n.t("test.fooTitle")
|
||||
);
|
||||
|
||||
this.setProperties({
|
||||
title: null,
|
||||
translatedTitle: "bar"
|
||||
});
|
||||
|
||||
assert.equal(find("button")[0].getAttribute("title"), "bar");
|
||||
}
|
||||
});
|
||||
|
||||
componentTest("label", {
|
||||
template: "{{d-button label=label translatedLabel=translatedLabel}}",
|
||||
|
||||
beforeEach() {
|
||||
I18n.translations[I18n.locale].js.test = { fooLabel: "foo" };
|
||||
},
|
||||
|
||||
test(assert) {
|
||||
this.set("label", "test.fooLabel");
|
||||
|
||||
assert.equal(
|
||||
find("button .d-button-label").text(),
|
||||
I18n.t("test.fooLabel")
|
||||
);
|
||||
|
||||
this.setProperties({
|
||||
label: null,
|
||||
translatedLabel: "bar"
|
||||
});
|
||||
|
||||
assert.equal(find("button .d-button-label").text(), "bar");
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user