Bug 1336937 - Add aria-pressed to the filter buttons in new console. r=jdescottes
authorNicolas Chevobbe <chevobbe.nicolas@gmail.com>
Mon, 06 Feb 2017 13:41:08 +0100
changeset 341129 56b0d9ecb97b83a94f8edef1a44f3b3926facd5d
parent 341128 b2d14d738d2c38bd56225340b4dad320fe50bc7d
child 341130 5ef27c9b65efd9457f65d014082c2383bbd4aad7
push id86634
push usercbook@mozilla.com
push dateTue, 07 Feb 2017 13:14:58 +0000
treeherdermozilla-inbound@9dbd2d9b334e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes
bugs1336937
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1336937 - Add aria-pressed to the filter buttons in new console. r=jdescottes MozReview-Commit-ID: FEvuSd3RQ67
devtools/client/webconsole/new-console-output/components/filter-button.js
devtools/client/webconsole/new-console-output/test/components/filter-button.test.js
--- a/devtools/client/webconsole/new-console-output/components/filter-button.js
+++ b/devtools/client/webconsole/new-console-output/components/filter-button.js
@@ -32,15 +32,16 @@ const FilterButton = createClass({
       "menu-filter-button",
       filterKey,
     ];
     if (active) {
       classList.push("checked");
     }
 
     return dom.button({
+      "aria-pressed": active === true,
       className: classList.join(" "),
       onClick: this.onClick
     }, label);
   }
 });
 
 module.exports = FilterButton;
--- a/devtools/client/webconsole/new-console-output/test/components/filter-button.test.js
+++ b/devtools/client/webconsole/new-console-output/test/components/filter-button.test.js
@@ -15,20 +15,21 @@ describe("FilterButton component:", () =
     active: true,
     label: "Error",
     filterKey: MESSAGE_LEVEL.ERROR,
   };
 
   it("displays as active when turned on", () => {
     const wrapper = render(FilterButton(props));
     expect(wrapper.html()).toBe(
-      "<button class=\"menu-filter-button error checked\">Error</button>"
+      "<button aria-pressed=\"true\" class=\"menu-filter-button error checked\">" +
+      "Error</button>"
     );
   });
 
   it("displays as inactive when turned off", () => {
     const inactiveProps = Object.assign({}, props, { active: false });
     const wrapper = render(FilterButton(inactiveProps));
     expect(wrapper.html()).toBe(
-      "<button class=\"menu-filter-button error\">Error</button>"
+      "<button aria-pressed=\"false\" class=\"menu-filter-button error\">Error</button>"
     );
   });
 });