import { expect } from 'chai' import { polyfill } from '../mod.js' describe('Custom Elements', () => { const target = {} beforeEach(() => polyfill(target)) it('Includes Custom Element functionality', () => { expect(target).to.have.property('CustomElementRegistry') expect(target).to.have.property('customElements') expect(target).to.have.property('HTMLElement') }) it('Supports Custom Element creation', () => { const CustomElement = class HTMLCustomElement extends target.HTMLElement {} target.customElements.define('custom-element', CustomElement) expect(target.customElements.get('custom-element')).to.equal(CustomElement) expect(target.customElements.getName(CustomElement)).to.equal( 'custom-element' ) }) it('Supports Custom Elements created from Document', () => { expect(target.document.body.localName).to.equal('body') expect(target.document.body.tagName).to.equal('BODY') expect( target.document.createElement('custom-element').constructor.name ).to.equal('HTMLUnknownElement') const CustomElement = class HTMLCustomElement extends target.HTMLElement {} target.customElements.define('custom-element', CustomElement) expect( target.document.createElement('custom-element').constructor.name ).to.equal('HTMLCustomElement') }) it('Supports Custom Elements with properties', () => { const testSymbol = Symbol.for('webapi.test') const CustomElement = class HTMLCustomElement extends target.HTMLElement { otherMethod = () => testSymbol method() { return this.otherMethod() } static method() { return this.otherMethod() } static otherMethod() { return testSymbol } } target.customElements.define('custom-element', CustomElement) expect(CustomElement.method()).to.equal(testSymbol) const customElement = new CustomElement() expect(customElement.method()).to.equal(testSymbol) }) }) 'v0.2'/>
path: root/index.php (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2016-11-06[CHANGELOG] Update changelogGravatar logmanoriginal 1-26/+18
2016-11-05PHP settingsGravatar Marcus Rohrmoser 2-1/+2
2016-11-05[Arte7] Fix broken feedGravatar logmanoriginal 1-1/+1
2016-11-05[index] Add check for 'allow_url_fopen'Gravatar logmanoriginal 1-0/+4
2016-11-05[index] Add check for 'libxml' extensionGravatar logmanoriginal 1-0/+3
2016-11-05[index] Add check for correct PHP versionGravatar logmanoriginal 1-1/+8
2016-11-05[Arte7] Fix content parsingGravatar logmanoriginal 1-5/+6
2016-10-20[index] Initialize variable before using itGravatar logmanoriginal 1-1/+2
2016-10-20Update README.mdGravatar LogMANOriginal 1-0/+1
2016-10-20[index] Fixes a bug where requests could result in same cache file namesGravatar logmanoriginal 1-6/+6
2016-10-18[DuckDuckGoBridge] Add ability to sort by relevance instead of date.Gravatar JeremyRand 1-3/+16
2016-10-16[FeedExpander] Remove orphan getDescription functionGravatar logmanoriginal 1-9/+0
2016-10-16[FileCache] Change output format to JSONGravatar logmanoriginal 1-4/+3
2016-10-08[contents] Use FileCache for getSimpleHTMLDOMCachedGravatar logmanoriginal 1-20/+14
2016-10-08[index] Introduce CACHE_DIRGravatar logmanoriginal 1-1/+4
2016-10-08[cache] Specify cache duration for 'purgeCache'Gravatar logmanoriginal 3-5/+4
2016-10-08[FileCache] Add property to define cache folderGravatar logmanoriginal 2-9/+30
2016-10-08[FileCache] Change parameters to lower-caseGravatar logmanoriginal 1-1/+1
2016-10-08[index] Initialize cache before loading to bridgeGravatar logmanoriginal 2-6/+8
2016-10-08[FileCache] Remove 'isPrepareCache'Gravatar logmanoriginal 1-19/+4
2016-10-08[FileCache] Build file name solely on given parametersGravatar logmanoriginal 1-4/+1
2016-10-08[FileCache] Rename 'prepare' to 'setParameters'Gravatar logmanoriginal 2-3/+7
2016-10-08[cache] Directly implement CacheInterface in FileCacheGravatar logmanoriginal 4-14/+10
2016-10-07[FileCache] Implement recursive directory creationGravatar logmanoriginal 1-3/+2
2016-10-07[FileCache] Assign same permission to group as othersGravatar logmanoriginal 1-2/+2
2016-10-07[FileCache] Don't store folder creation statusGravatar logmanoriginal 1-4/+1
2016-10-07[FileCache] Build path using function instead of constantGravatar logmanoriginal 1-1/+1
2016-10-07[Cache] Move 'purge' function to implementationsGravatar logmanoriginal 4-23/+23
2016-10-07[Cache] Remove orphan function utf8_encode_deepGravatar logmanoriginal 2-22/+0
2016-10-06Update README.mdGravatar LogMANOriginal 1-0/+1
2016-10-06[Webfail] Fix titles with single quotesGravatar logmanoriginal 1-1/+1
2016-10-06Update ReadComicsBridge.phpGravatar niawag 1-1/+1
2016-10-06Update ReadComicsBridge.phpGravatar niawag 1-1/+1