@@ -20,27 +20,27 @@ describe('Declarative ShadowRoot', () => {
2020 const host = document . getElementById ( 'host2' ) ;
2121 expect ( host . shadowRoot ) . not . to . be . null ;
2222 expect ( host . shadowRoot . customElementRegistry ) . to . be . null ;
23- // const ce = host.shadowRoot.firstElementChild;
24- // expect(ce.customElementRegistry).to.be.null;
25- // expect(ce).not.to.be.instanceOf(customElements.get(ce.localName));
23+ const ce = host . shadowRoot . firstElementChild ;
24+ expect ( ce . customElementRegistry ) . to . be . null ;
25+ expect ( ce ) . not . to . be . instanceOf ( customElements . get ( ce . localName ) ) ;
2626 } ) ;
2727
28- // it('should customize when registry initializes', () => {
29- // const host = document.getElementById('host2');
30- // const registry = new CustomElementRegistry();
31- // class RegistryDsdElement extends HTMLElement {
32- // constructor() {
33- // super();
34- // this.attachShadow({
35- // mode: 'open',
36- // }).innerHTML = `${this.localName}: scoped`;
37- // }
38- // }
39- // registry.define('dsd-element', RegistryDsdElement);
40- // registry.initialize(host.shadowRoot);
41- // expect(host.shadowRoot.customElementRegistry).to.be.equal(registry);
42- // const ce = host.shadowRoot.firstElementChild;
43- // expect(ce.customElementRegistry).to.be.equal(registry);
44- // expect(ce).to.be.instanceOf(RegistryDsdElement);
45- // });
28+ it ( 'should customize when registry initializes' , ( ) => {
29+ const host = document . getElementById ( 'host2' ) ;
30+ const registry = new CustomElementRegistry ( ) ;
31+ class RegistryDsdElement extends HTMLElement {
32+ constructor ( ) {
33+ super ( ) ;
34+ this . attachShadow ( {
35+ mode : 'open' ,
36+ } ) . innerHTML = `${ this . localName } : scoped` ;
37+ }
38+ }
39+ registry . define ( 'dsd-element' , RegistryDsdElement ) ;
40+ registry . initialize ( host . shadowRoot ) ;
41+ expect ( host . shadowRoot . customElementRegistry ) . to . be . equal ( registry ) ;
42+ const ce = host . shadowRoot . firstElementChild ;
43+ expect ( ce . customElementRegistry ) . to . be . equal ( registry ) ;
44+ expect ( ce ) . to . be . instanceOf ( RegistryDsdElement ) ;
45+ } ) ;
4646} ) ;
0 commit comments