(ampParent)
| 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); |
no test coverage detected