()
| 422 | }); |
| 423 | |
| 424 | function testAmpComponents() { |
| 425 | const imgPromise = RequestBank.withdraw('image').then((req) => { |
| 426 | expect(req.url).to.equal('/'); |
| 427 | }); |
| 428 | const pixelPromise = RequestBank.withdraw('pixel').then((req) => { |
| 429 | expect(req.url).to.equal('/foo?cid='); |
| 430 | }); |
| 431 | const analyticsPromise = RequestBank.withdraw('analytics').then((req) => { |
| 432 | expect(req.url).to.match(/^\/bar\?/); |
| 433 | const queries = parseQueryString(req.url.substr('/bar'.length)); |
| 434 | expect(queries['cid']).to.equal(''); |
| 435 | expect(queries['sourceUrl']).be.ok; |
| 436 | // Cookie is sent via http response header when requesting |
| 437 | // localhost:9876/amp4test/a4a/ |
| 438 | // COOKIE macro is not allowed in inabox and resolves to empty |
| 439 | expect(queries['cookie']).to.equal(''); |
| 440 | }); |
| 441 | return Promise.all([imgPromise, pixelPromise, analyticsPromise]); |
| 442 | } |
| 443 | |
| 444 | function testAmpComponentsBTF(win) { |
| 445 | // The iframe starts BTF. "visible" trigger should be after scroll. |
no test coverage detected