forked from andreasbm/weightless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
icon.test.ts
29 lines (24 loc) · 826 Bytes
/
icon.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { assignedNodesMap, createContainer, removeContainer, waitForElement } from "../../test/testing-helpers";
import "../icon";
import { Icon } from "./icon";
describe("wl-divider", () => {
const {expect} = chai;
let $icon: Icon;
let $container: HTMLElement;
before(() => {
$container = createContainer();
});
beforeEach(async () => {
$container.innerHTML = `<wl-icon>flash_on</wl-icon>`;
await waitForElement("wl-icon");
$icon = $container.querySelector<Icon>("wl-icon")!;
});
after(() => removeContainer($container));
it("should have an presentation role", () => {
expect($icon.getAttribute("role")).to.equal("presentation");
});
it("should render the slots", async () => {
const assignedNodes = assignedNodesMap($icon.shadowRoot!);
expect(assignedNodes[""].length).to.be.above(0);
});
});