|
1 | 1 | import { expect } from '@vaadin/chai-plugins'; |
2 | | -import { fixtureSync, nextRender } from '@vaadin/testing-helpers'; |
| 2 | +import { fixtureSync } from '@vaadin/testing-helpers'; |
3 | 3 | import '../vaadin-breadcrumbs.js'; |
4 | | -import '../vaadin-breadcrumbs-item.js'; |
5 | 4 |
|
6 | 5 | window.Vaadin ??= {}; |
7 | 6 | window.Vaadin.featureFlags ??= {}; |
8 | 7 | window.Vaadin.featureFlags.breadcrumbsComponent = true; |
9 | 8 |
|
10 | 9 | describe('vaadin-breadcrumbs', () => { |
11 | | - it('should register vaadin-breadcrumbs in the custom element registry', () => { |
12 | | - expect(customElements.get('vaadin-breadcrumbs')).to.be.ok; |
13 | | - }); |
| 10 | + let breadcrumbs; |
14 | 11 |
|
15 | | - it('should register vaadin-breadcrumbs-item in the custom element registry', () => { |
16 | | - expect(customElements.get('vaadin-breadcrumbs-item')).to.be.ok; |
| 12 | + beforeEach(() => { |
| 13 | + breadcrumbs = fixtureSync('<vaadin-breadcrumbs></vaadin-breadcrumbs>'); |
17 | 14 | }); |
18 | 15 |
|
19 | | - it('should attach the breadcrumbs with a non-null shadowRoot', async () => { |
20 | | - const breadcrumbs = fixtureSync('<vaadin-breadcrumbs></vaadin-breadcrumbs>'); |
21 | | - await nextRender(); |
22 | | - expect(breadcrumbs.shadowRoot).to.not.be.null; |
23 | | - }); |
| 16 | + describe('custom element definition', () => { |
| 17 | + let tagName; |
| 18 | + |
| 19 | + beforeEach(() => { |
| 20 | + tagName = breadcrumbs.tagName.toLowerCase(); |
| 21 | + }); |
| 22 | + |
| 23 | + it('should be defined in custom element registry', () => { |
| 24 | + expect(customElements.get(tagName)).to.be.ok; |
| 25 | + }); |
24 | 26 |
|
25 | | - it('should attach the item with a non-null shadowRoot', async () => { |
26 | | - const item = fixtureSync('<vaadin-breadcrumbs-item></vaadin-breadcrumbs-item>'); |
27 | | - await nextRender(); |
28 | | - expect(item.shadowRoot).to.not.be.null; |
| 27 | + it('should have a valid static "is" getter', () => { |
| 28 | + expect(customElements.get(tagName).is).to.equal(tagName); |
| 29 | + }); |
29 | 30 | }); |
30 | 31 | }); |
0 commit comments