Skip to content

Commit

Permalink
fix: address a11y issues raised by updating our dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Westbrook committed Jan 20, 2021
1 parent f0d06bf commit 4f06477
Show file tree
Hide file tree
Showing 9 changed files with 2,593 additions and 3,845 deletions.
8 changes: 2 additions & 6 deletions documentation/src/components/code-example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,11 @@ export class CodeExample extends FocusVisiblePolyfillMixin(LitElement) {
${this.showDemo
? html`
<div class="demo-example">
<slot name="demo">
${renderedCode}
</slot>
<slot name="demo">${renderedCode}</slot>
</div>
`
: undefined}
<bdo id="markup" dir="ltr">
${highlightedCode}
</bdo>
<bdo id="markup" dir="ltr">${highlightedCode}</bdo>
`;
}

Expand Down
4 changes: 1 addition & 3 deletions documentation/src/components/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ function buildTable(
<tr>
${headings.map(
(heading) => html`
<th class="spectrum-Table-headCell">
${heading}
</th>
<th class="spectrum-Table-headCell">${heading}</th>
`
)}
</tr>
Expand Down
4 changes: 2 additions & 2 deletions packages/bar-loader/test/bar-loader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('BarLoader', () => {
it('loads default bar-loader accessibly', async () => {
const el = await fixture<BarLoader>(
html`
<sp-bar-loader></sp-bar-loader>
<sp-bar-loader label="Loading"></sp-bar-loader>
`
);

Expand Down Expand Up @@ -55,7 +55,7 @@ describe('BarLoader', () => {
});
it('loads - [indeterminate]', async () => {
const el = await fixture<BarLoader>(html`
<sp-bar-loader indeterminate></sp-bar-loader>
<sp-bar-loader indeterminate label="Loading"></sp-bar-loader>
`);

await elementUpdated(el);
Expand Down
4 changes: 2 additions & 2 deletions packages/circle-loader/test/circleloader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { fixture, elementUpdated, html, expect } from '@open-wc/testing';
describe('Circle Loader', () => {
it('loads', async () => {
const el = await fixture<CircleLoader>(html`
<sp-circle-loader></sp-circle-loader>
<sp-circle-loader label="Loading"></sp-circle-loader>
`);

await elementUpdated(el);
Expand All @@ -27,7 +27,7 @@ describe('Circle Loader', () => {
});
it('loads - [indeterminate]', async () => {
const el = await fixture<CircleLoader>(html`
<sp-circle-loader indeterminate></sp-circle-loader>
<sp-circle-loader indeterminate label="Loading"></sp-circle-loader>
`);

await elementUpdated(el);
Expand Down
2 changes: 1 addition & 1 deletion packages/menu/src/MenuGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class MenuGroup extends SpectrumElement {
<span class="header" id=${labelledby} aria-hidden="true">
<slot name="header"></slot>
</span>
<div aria-labelledby=${labelledby} role="presentation">
<div role="presentation">
<slot></slot>
</div>
`;
Expand Down
57 changes: 8 additions & 49 deletions packages/menu/test/menu-group.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ governing permissions and limitations under the License.
import '../sp-menu-group.js';
import '../sp-menu.js';
import '../sp-menu-item.js';
import { MenuGroup, Menu } from '../';
import { Menu } from '../';
import { fixture, elementUpdated, html, expect } from '@open-wc/testing';

describe('Menu group', () => {
Expand All @@ -21,64 +21,23 @@ describe('Menu group', () => {
html`
<sp-menu>
<sp-menu-group>
<span slot="header">
Section Heading
</span>
<sp-menu-item>
Action 1
</sp-menu-item>
<sp-menu-item>
Action 2
</sp-menu-item>
<sp-menu-item>
Action 3
</sp-menu-item>
<span slot="header">Section Heading</span>
<sp-menu-item>Action 1</sp-menu-item>
<sp-menu-item>Action 2</sp-menu-item>
<sp-menu-item>Action 3</sp-menu-item>
</sp-menu-group>
<sp-menu-divider></sp-menu-divider>
<sp-menu-group>
<span slot="header">
Section Heading
</span>
<sp-menu-item>
Save
</sp-menu-item>
<sp-menu-item disabled>
Download
</sp-menu-item>
<span slot="header">Section Heading</span>
<sp-menu-item>Save</sp-menu-item>
<sp-menu-item disabled>Download</sp-menu-item>
</sp-menu-group>
</sp-menu>
`
);

await elementUpdated(el);

const firstGroup = el.querySelector(
'sp-menu-group:nth-of-type(1)'
) as MenuGroup;
const secondGroup = el.querySelector(
'sp-menu-group:nth-of-type(2)'
) as MenuGroup;
const firstLabelledByEl = firstGroup.shadowRoot
? (firstGroup.shadowRoot.querySelector(
'[aria-labelledby]'
) as HTMLDivElement)
: null;
const secondLabelledByEl = secondGroup.shadowRoot
? (secondGroup.shadowRoot.querySelector(
'[aria-labelledby]'
) as HTMLDivElement)
: null;
const firstLabelledById = firstLabelledByEl
? (firstLabelledByEl.getAttribute('aria-labelledby') as string)
: null;
const secondLabelledById = secondLabelledByEl
? (secondLabelledByEl.getAttribute('aria-labelledby') as string)
: null;

expect(firstLabelledById).to.not.be.null;
expect(secondLabelledById).to.not.be.null;
expect(firstLabelledById).to.not.equal(secondLabelledById);

await expect(el).to.be.accessible();
});
});
2 changes: 1 addition & 1 deletion packages/meter/test/meter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Meter', () => {
it('loads default meter accessibly', async () => {
const el = await fixture<Meter>(
html`
<sp-meter></sp-meter>
<sp-meter label="Loading"></sp-meter>
`
);

Expand Down
1 change: 0 additions & 1 deletion packages/modal/src/spectrum-modal-wrapper.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ THIS FILE IS MACHINE GENERATED. DO NOT EDIT */
width: 100vw;
height: 100vh;
height: -webkit-fill-available;
height: -webkit-stretch;
height: -moz-available;
height: fill-available;
visibility: hidden;
Expand Down
Loading

0 comments on commit 4f06477

Please sign in to comment.