Skip to content

Commit

Permalink
docs(checkbox): add group checkbox to element's demo page
Browse files Browse the repository at this point in the history
  • Loading branch information
phetw committed Oct 20, 2021
1 parent 9e26df5 commit 64684a3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 14 additions & 0 deletions packages/elements/src/checkbox/__demo__/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
.ellipsis {
width: 200px;
}
.group {
display: flex;
flex-direction: column;
}
</style>
<script type="module">
import '@refinitiv-ui/elements/checkbox';
Expand All @@ -24,6 +28,16 @@
<ef-checkbox></ef-checkbox>
</demo-block>

<demo-block header="Group Checkbox" tags="accessibility">
<div role="group" aria-label="sandwitch condiment" class="group">
<h6>Sandwich Condiments</h6>
<ef-checkbox>Lettuce</ef-checkbox>
<ef-checkbox>Tomato</ef-checkbox>
<ef-checkbox checked>Mustard</ef-checkbox>
<ef-checkbox>Sprouts</ef-checkbox>
</div>
</demo-block>

<!-- TRUNCATE CHECKBOX -->
<demo-block header="Truncate Checkbox">
<ef-checkbox class="ellipsis">Checkbox with very long long long text</ef-checkbox>
Expand Down
4 changes: 0 additions & 4 deletions packages/elements/src/checkbox/__test__/checkbox.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,11 @@ describe('checkbox/Checkbox', () => {
});
it('should pass a11y test when disabled', async () => {
const el = await fixture(disabled);

await expect(el).to.be.accessible();
await expect(el.ariaChecked).to.equal('false');
});
it('should pass a11y test when readonly', async () => {
const el = await fixture(readonly);

await expect(el).to.be.accessible();
await expect(el.ariaChecked).to.equal('false');
});
})

Expand Down

0 comments on commit 64684a3

Please sign in to comment.