* Check all elements in the fixture are upgraded correctly. * @param {string} fixtureName * @param {!Array} testElements
(fixtureName, testElements)
| 19 | * @param {!Array} testElements |
| 20 | */ |
| 21 | function testLoadOrderFixture(fixtureName, testElements) { |
| 22 | let fixture; |
| 23 | return createFixtureIframe(fixtureName, 500) |
| 24 | .then((f) => { |
| 25 | fixture = f; |
| 26 | for (let i = 0; i < testElements.length; i++) { |
| 27 | expect(fixture.doc.querySelectorAll(testElements[i])).to.have.length(1); |
| 28 | } |
| 29 | return fixture.awaitEvent(AmpEvents_Enum.LOAD_START, testElements.length); |
| 30 | }) |
| 31 | .then(() => { |
| 32 | for (let i = 0; i < testElements.length; i++) { |
| 33 | const testElement = fixture.doc.querySelectorAll(testElements[i])[0]; |
| 34 | checkElementUpgrade(testElement); |
| 35 | if (testElement.tagName == 'AMP-FIT-TEXT') { |
| 36 | expect( |
| 37 | fixture.doc.getElementsByClassName('i-amphtml-fit-text-content') |
| 38 | ).to.have.length(1); |
| 39 | } |
| 40 | } |
| 41 | }); |
| 42 | } |
| 43 | |
| 44 | describes.sandboxed( |
| 45 | 'test extensions loading in multiple orders', |
no test coverage detected