Skip to content

Commit 07691d7

Browse files
committed
test that proves uui-icon can retrieve icon when it was instantiated as a child.
1 parent 9a5ca2a commit 07691d7

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

packages/uui-icon-registry-essential/lib/uui-icon-registry-essential.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { html, fixture, expect } from '@open-wc/testing';
22
import { UUIIconRegistryEssentialElement } from './uui-icon-registry-essential.element';
33
import '.';
4+
import { UUIIconElement } from '@umbraco-ui/uui-icon/lib';
45

56
describe('UUIIconRegistryEssentialElement', () => {
67
let element: UUIIconRegistryEssentialElement;
@@ -14,4 +15,23 @@ describe('UUIIconRegistryEssentialElement', () => {
1415
it('passes the a11y audit', async () => {
1516
await expect(element).shadowDom.to.be.accessible();
1617
});
18+
19+
describe('UUIIcon retrieves SVG data from icon registry', () => {
20+
let registryElement: UUIIconRegistryEssentialElement;
21+
let iconElement: UUIIconElement;
22+
23+
beforeEach(async () => {
24+
registryElement = await fixture(
25+
html`<uui-icon-registry-essential
26+
><uui-icon name="check"></uui-icon
27+
></uui-icon-registry-essential>`
28+
);
29+
30+
iconElement = registryElement.querySelector('uui-icon') as UUIIconElement;
31+
});
32+
33+
it('Child uui-icon retrieved some SVG data', () => {
34+
expect(iconElement.shadowRoot!.querySelector('svg')).to.exist;
35+
});
36+
});
1737
});

0 commit comments

Comments
 (0)