|
1 | | -import { assert } from "@sinonjs/referee-sinon"; |
| 1 | +import { assert, refute } from "@sinonjs/referee-sinon"; |
2 | 2 | import { fireEvent, waitForElement } from "@testing-library/dom"; |
3 | 3 | import { setupTest } from "./test-helper"; |
4 | 4 |
|
@@ -47,6 +47,32 @@ describe("Plete", function() { |
47 | 47 | }); |
48 | 48 | }); |
49 | 49 |
|
| 50 | + it("renders the list items with an `aria-label` attribute", function() { |
| 51 | + const listItems = this.list.querySelectorAll("plete-item"); |
| 52 | + |
| 53 | + assert.isTrue(listItems.length > 0); |
| 54 | + listItems.forEach(function(item) { |
| 55 | + refute.isNull(item.getAttribute("aria-label")); |
| 56 | + }); |
| 57 | + }); |
| 58 | + |
| 59 | + it("adds an `aria-activedescendant` attribute to the input", function() { |
| 60 | + const listItems = this.list.querySelectorAll("plete-item"); |
| 61 | + |
| 62 | + assert.isTrue(listItems.length > 0); |
| 63 | + refute.isNull(this.input); |
| 64 | + refute.isNull(this.input.getAttribute("aria-activedescendant")); |
| 65 | + }); |
| 66 | + |
| 67 | + it("renders the list items with an `id` attribute", function() { |
| 68 | + const listItems = this.list.querySelectorAll("plete-item"); |
| 69 | + |
| 70 | + assert.isTrue(listItems.length > 0); |
| 71 | + listItems.forEach(function(item) { |
| 72 | + refute.isNull(item.getAttribute("id")); |
| 73 | + }); |
| 74 | + }); |
| 75 | + |
50 | 76 | it("sets `aria-expanded` on the `plete` element to 'true'", function() { |
51 | 77 | const plete = this.input.closest("plete"); |
52 | 78 |
|
|
0 commit comments