import { expect } from '@open-wc/testing'; import { HonorlockElements } from '../src/HonorlockElements.js'; import { DefaultConfiguration } from '../src/Entities/DefaultConfiguration.js'; describe('HonorlockElements', () => { const element = new HonorlockElements(); it('defines the custom element', () => { element.init(DefaultConfiguration); expect(customElements.get('honorlock-elements')).to.not.be.undefined; expect(element.getConfigurations()[0].config.host).to.be.equal( 'app.honorlock.com' ); }); it('registers the window object', () => { expect(window.HonorlockElements).to.be.an.instanceof(HonorlockElements); }); it('resize updates the config', () => { element.resize({ height: 100, width: 100 }); expect(element.getConfigurations()[0].config.height).to.be.equal(100); expect(element.getConfigurations()[0].config.width).to.be.equal(100); }); });