Skip to content

Commit

Permalink
add integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouyx committed Jun 18, 2019
1 parent 3f4eb1a commit 3718e59
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 7 additions & 2 deletions build-system/amp4test.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,11 @@ app.use('/request-bank/:bid/teardown/', (req, res) => {
*/
app.get('/a4a/:bid', (req, res) => {
const {bid} = req.params;
const body = `
const preSet = `
<script>{
document.cookie = 'test-cookie=test';
}</script>`;
const body = preSet + `
<a href=https://ampbyexample.com target=_blank>
<amp-img alt="AMP Ad" height=250 src=//localhost:9876/amp4test/request-bank/${bid}/deposit/image width=300></amp-img>
</a>
Expand All @@ -211,7 +215,8 @@ app.get('/a4a/:bid', (req, res) => {
"navTiming": "\${navTiming(requestStart,requestStart)}",
"navType": "\${navType}",
"navRedirectCount": "\${navRedirectCount}",
"sourceUrl": "\${sourceUrl}"
"sourceUrl": "\${sourceUrl}",
"cookie": "COOKIE(test-cookie)"
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions test/integration/test-amp-inabox.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ describe
const queries = parseQueryString(req.url.substr('/bar'.length));
expect(queries['cid']).to.equal('');
expect(queries['sourceUrl']).be.ok;
expect(queries['cookie']).to.equal('');
});
return Promise.all([imgPromise, pixelPromise, analyticsPromise]);
}
Expand Down Expand Up @@ -143,6 +144,7 @@ describe
env => {
it('should layout amp-img, amp-pixel, amp-analytics', () => {
// See amp4test.js for creative content
debugger;
return testAmpComponents();
});

Expand Down

0 comments on commit 3718e59

Please sign in to comment.