MCPcopy Index your code
hub / github.com/ampproject/amphtml / a2aSuccess

Function a2aSuccess

test/unit/test-alp-handler.js:85–98  ·  view source on GitHub ↗
(ampParent)

Source from the content-addressed store, hash-verified

83 }
84
85 function a2aSuccess(ampParent) {
86 handleClick(event);
87 expect(event.preventDefault).to.be.calledOnce;
88 expect(ampParent.postMessage).to.be.calledOnce;
89 expect(ampParent.postMessage.lastCall.args[0]).to.equal(
90 'a2a;{"url":"https://cdn.ampproject.org/c/www.example.com/amp.html' +
91 '#click=https%3A%2F%2Ftest.com%3Famp%3D1%26adurl%3Dhttps%253A%252F%' +
92 '252Fcdn.ampproject.org%252Fc%252Fwww.example.com%252Famp.html"}'
93 );
94 expect(ampParent.postMessage.lastCall.args[1]).to.equal(
95 'https://cdn.ampproject.org'
96 );
97 expect(open).to.have.not.been.called;
98 }
99
100 function noNavigation() {
101 handleClick(event);

Callers 1

Calls 2

handleClickFunction · 0.90
expectFunction · 0.85

Tested by

no test coverage detected