Skip to content

Commit

Permalink
Added amp-ad test + fixed template-validator test.
Browse files Browse the repository at this point in the history
  • Loading branch information
glevitzky committed Jul 13, 2018
1 parent ae7af3f commit d01f393
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion extensions/amp-a4a/0.1/test/test-template-validator.js
Expand Up @@ -176,7 +176,7 @@ describes.realWin('TemplateValidator', realWinConfig, env => {
expect(validatorOutput.creativeData).to.be.ok;
const {creativeData} = validatorOutput;
expect(creativeData).to.be.ok;
expect(creativeData.creative).to.deep.equal(
expect(creativeData.crossDomainData.creative).to.deep.equal(
'{"templateUrl":"https://adnetwork.com/amp-template.html"}');
});
});
Expand Down
8 changes: 8 additions & 0 deletions extensions/amp-ad/0.1/test/test-amp-ad.js
Expand Up @@ -16,6 +16,7 @@

import {AmpAd} from '../amp-ad';
import {AmpAd3PImpl} from '../amp-ad-3p-impl';
import {AmpAdTemplate} from '../../../amp-a4a/0.1/amp-ad-template';
import {Services} from '../../../../src/services';
import {adConfig} from '../../../../ads/_config';
import {getA4ARegistry} from '../../../../ads/_a4a-config';
Expand Down Expand Up @@ -113,6 +114,13 @@ describes.realWin('Ad loader', {amp: true}, env => {
});
});

it('uses AmpAdTemplate when template attribute is present', () => {
ampAdElement.setAttribute('template', true);
ampAdElement.setAttribute('type', 'test');
return expect(ampAd.upgradeCallback()).to.eventually.be
.instanceof(AmpAdTemplate);
});

it('fails upgrade on A4A upgrade with loadElementClass error', () => {
a4aRegistry['zort'] = function() {
return true;
Expand Down

0 comments on commit d01f393

Please sign in to comment.