|
1 | | -import ContextUtil, { browserEnv, dom, getFocusableElements, iOSMobile } from "../utils" |
| 1 | +import ContextUtil, { dom, getFocusableElements } from "../utils" |
| 2 | + |
| 3 | +const testDom = `<div data-tester="true" data-removable class="wrapper"> |
| 4 | + <p>Hello world! <a href="#">this link is focusable</a> </p> |
| 5 | + <p class="hello world test">Hello world again! <button type="button">I too, am focusable!</button></p> |
| 6 | + </div>\ |
| 7 | +` |
| 8 | + |
| 9 | +describe("dom", () => { |
| 10 | + beforeEach(() => { |
| 11 | + document.body.innerHTML = testDom |
| 12 | + }) |
| 13 | + |
| 14 | + it("can get an attribute", () => {}) |
| 15 | + it("can set an attribute", () => {}) |
| 16 | + it("can remove an attribute", () => {}) |
| 17 | + it("can detect an attribute", () => {}) |
| 18 | + it("can retrieve an element", () => {}) |
| 19 | + it("can retrieve a collection of elements", () => {}) |
| 20 | + it("can retrieve css properties", () => {}) |
| 21 | + it("can set css properties", () => {}) |
| 22 | + it("can add a class", () => {}) |
| 23 | + it("can add multiple classes", () => {}) |
| 24 | + it("can remove a class from", () => {}) |
| 25 | + it("can remove multiple classes from", () => {}) |
| 26 | + it("can detect a class", () => {}) |
| 27 | + it("can detect a class from multiple inputs", () => {}) |
| 28 | +}) |
| 29 | + |
| 30 | +describe("getFocusableElements", () => { |
| 31 | + it("returns all focusable elements within a wrapper", () => { |
| 32 | + document.body.innerHTML = testDom |
| 33 | + const elements = getFocusableElements(".wrapper") |
| 34 | + expect(elements).toHaveLength(2) |
| 35 | + }) |
| 36 | +}) |
2 | 37 |
|
3 | | -describe("browserEnv", () => {}) |
4 | | -describe("dom", () => {}) |
5 | | -describe("getFocusableElements", () => {}) |
6 | | -describe("iOSMobile", () => {}) |
7 | 38 | describe("ContextUtil", () => {}) |
0 commit comments