Skip to content

Commit

Permalink
✅ Unskip tests that were skipped due to console errors (#14549)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsimha committed Apr 12, 2018
1 parent 8430605 commit 97847f2
Show file tree
Hide file tree
Showing 61 changed files with 495 additions and 666 deletions.
3 changes: 1 addition & 2 deletions ads/google/a4a/test/test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ describe('Google A4A utils', () => {
},
};

// TODO(zhouyx, #14336): Fails due to console errors.
it.skip('should extract correct config from header', () => {
it('should extract correct config from header', () => {
return createIframePromise().then(fixture => {
setupForAdTesting(fixture);
let url;
Expand Down
3 changes: 1 addition & 2 deletions ads/google/test/test-doubleclick.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ describes.sandboxed('writeAdScript', {}, env => {
verifyScript(win, 'gpt.js');
});

// TODO(bradfrizzell, #14336): Fails due to console errors.
it.skip('should use GPT when multiSize is not null', () => {
it('should use GPT when multiSize is not null', () => {
const data = {multiSize: 'hey!'};
writeAdScript(win, data);
verifyScript(win, 'gpt.js');
Expand Down
23 changes: 7 additions & 16 deletions extensions/amp-a4a/0.1/test/test-amp-a4a.js
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,7 @@ describe('amp-a4a', () => {
a4a.onLayoutMeasure();
});

// TODO(lannka, #14336): Fails due to console errors.
it.skip('should render via cached iframe', () => {
it('should render via cached iframe', () => {
return a4a.layoutCallback().then(() => {
verifyCachedContentIframeRender(a4aElement, TEST_URL);
// Should have reported an error.
Expand All @@ -657,9 +656,7 @@ describe('amp-a4a', () => {
});
});

// TODO(keithwrightbos, #14336): Fails due to console errors.
it.skip('should fire amp-analytics triggers for illegal ' +
'render modes', () => {
it('should fire amp-analytics triggers for illegal render modes', () => {
const triggerAnalyticsEventSpy =
sandbox.spy(analytics, 'triggerAnalyticsEvent');
return a4a.layoutCallback().then(() => {
Expand Down Expand Up @@ -716,8 +713,7 @@ describe('amp-a4a', () => {

['', 'client_cache', 'safeframe', 'some_random_thing'].forEach(
headerVal => {
// TODO(lannka, #14336): Fails due to console errors.
it.skip(`should not attach a NameFrame when header is ${headerVal}`,
it(`should not attach a NameFrame when header is ${headerVal}`,
() => {
// Make sure there's no signature, so that we go down the 3p iframe path.
delete adResponse.headers['AMP-Fast-Fetch-Signature'];
Expand Down Expand Up @@ -808,8 +804,7 @@ describe('amp-a4a', () => {

['', 'client_cache', 'nameframe', 'some_random_thing'].forEach(
headerVal => {
// TODO(lannka, #14336): Fails due to console errors.
it.skip(`should not attach a SafeFrame when header is ${headerVal}`,
it(`should not attach a SafeFrame when header is ${headerVal}`,
() => {
// If rendering type is anything but safeframe, we SHOULD NOT attach a
// SafeFrame.
Expand Down Expand Up @@ -1359,8 +1354,7 @@ describe('amp-a4a', () => {
}));
});
});
it('should handle XHR error when resolves after ' +
'layoutCallback', () => {
it('should handle XHR error when resolves after layoutCallback', () => {
return createIframePromise().then(fixture => {
setupForAdTesting(fixture);
let rejectXhr;
Expand Down Expand Up @@ -2216,9 +2210,7 @@ describes.realWin('AmpA4a-RTC', {amp: true}, env => {
expect(AMP.maybeExecuteRealTimeConfig).to.be.undefined;
expect(a4a.tryExecuteRealTimeConfig_()).to.be.undefined;
});
// TODO(bradfrizzell, #14336): Fails due to console errors.
it.skip('should log user error if RTC Config set but RTC not ' +
'supported', () => {
it('should log user error if RTC Config set but RTC not supported', () => {
element.setAttribute('rtc-config',
JSON.stringify({'urls': ['https://a.com']}));
expect(a4a.tryExecuteRealTimeConfig_()).to.be.undefined;
Expand All @@ -2235,8 +2227,7 @@ describes.realWin('AmpA4a-RTC', {amp: true}, env => {
expect(AMP.maybeExecuteRealTimeConfig.called).to.be.true;
expect(AMP.maybeExecuteRealTimeConfig.calledWith(a4a, macros)).to.be.true;
});
// TODO(bradfrizzell, #14336): Fails due to console errors.
it.skip('should catch error in maybeExecuteRealTimeConfig', () => {
it('should catch error in maybeExecuteRealTimeConfig', () => {
const err = new Error('Test');
AMP.maybeExecuteRealTimeConfig = sandbox.stub().throws(err);
a4a.tryExecuteRealTimeConfig_();
Expand Down
3 changes: 1 addition & 2 deletions extensions/amp-access/0.1/test/test-amp-access-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ describes.fakeWin('AccessSource', {
});
});

// TODO(dvoytenko, #14336): Fails due to console errors.
it.skip('should parse type', () => {
it('should parse type', () => {
let config = {
'authorization': 'https://acme.com/a',
'pingback': 'https://acme.com/p',
Expand Down
3 changes: 1 addition & 2 deletions extensions/amp-access/0.1/test/test-amp-access.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,7 @@ describes.fakeWin('AccessService authorization', {
});
});

// TODO(dvoytenko, #14336): Fails due to console errors.
it.skip('should use fallback on authorization failure when available', () => {
it('should use fallback on authorization failure when available', () => {
expectGetReaderId('reader1');
adapterMock.expects('authorize')
.withExactArgs()
Expand Down
3 changes: 1 addition & 2 deletions extensions/amp-access/0.1/test/test-login-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,7 @@ describes.sandboxed('WebLoginDialog', {}, () => {
expect(windowApi.open.firstCall.args[0]).to.equal('');
});

// TODO(dvoytenko, #14336): Fails due to console errors.
it.skip('should yield error if window.open fails', () => {
it('should yield error if window.open fails', () => {
// Open is called twice due to retry on _top.
windowMock.expects('open').twice().throws('OPEN ERROR');
return openLoginDialog(ampdoc, 'http://acme.com/login')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ describes.realWin('amp-ad-network-adsense-impl', {
element.setAttribute('width', '666');
expect(impl.isValidElement()).to.be.false;
});
it('should NOT be valid (responsive with missing ' +
'data-full-width)', () => {
it('should NOT be valid (responsive with missing data-full-width)', () => {
isResponsiveStub.callsFake(() => true);
element.setAttribute('height', '320');
element.setAttribute('width', '100vw');
Expand Down Expand Up @@ -859,8 +858,8 @@ describes.realWin('amp-ad-network-adsense-impl', {
}
doc.body.style.direction = '';
});
// TODO(charliereams, #14336): Fails due to console errors.
it.skip('should change left margin for responsive', () => {

it('should change left margin for responsive', () => {
containerContainer = doc.createElement('div');
container = doc.createElement('div');
return buildImpl({
Expand All @@ -875,8 +874,7 @@ describes.realWin('amp-ad-network-adsense-impl', {
});
});

// TODO(charliereams, #14336): Fails due to console errors.
it.skip('should change right margin for responsive in RTL', () => {
it('should change right margin for responsive in RTL', () => {
containerContainer = doc.createElement('div');
container = doc.createElement('div');
doc.body.style.direction = 'rtl'; // todo: revert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -913,8 +913,7 @@ describes.realWin('amp-ad-network-doubleclick-impl', realWinConfig, env => {
});
});

// TODO(glevitzky, #14336): Fails due to console errors.
it.skip('should force iframe to match size of creative', () => {
it('should force iframe to match size of creative', () => {
sandbox.stub(impl, 'sendXhrRequest').returns(
mockSendXhrRequest('150x50'));
impl.buildCallback();
Expand All @@ -927,8 +926,7 @@ describes.realWin('amp-ad-network-doubleclick-impl', realWinConfig, env => {
});
});

// TODO(glevitzky, #14336): Fails due to console errors.
it.skip('amp creative - should force iframe to match size of slot', () => {
it('amp creative - should force iframe to match size of slot', () => {
stubForAmpCreative();
sandbox.stub(impl, 'sendXhrRequest').callsFake(mockSendXhrRequest);
sandbox.stub(impl, 'renderViaCachedContentIframe_').callsFake(
Expand All @@ -948,8 +946,7 @@ describes.realWin('amp-ad-network-doubleclick-impl', realWinConfig, env => {
});
});

// TODO(glevitzky, #14336): Fails due to console errors.
it.skip('should force iframe to match size of slot', () => {
it('should force iframe to match size of slot', () => {
sandbox.stub(impl, 'sendXhrRequest').callsFake(mockSendXhrRequest);
sandbox.stub(impl, 'renderViaCachedContentIframe_').callsFake(
() => impl.iframeRenderHelper_({src: impl.adUrl_, name: 'name'}));
Expand All @@ -965,9 +962,7 @@ describes.realWin('amp-ad-network-doubleclick-impl', realWinConfig, env => {
});
});

// TODO(glevitzky, #14336): Fails due to console errors.
it.skip('should issue an ad request even with bad multi-size ' +
'data attr', () => {
it('should issue an ad request even with bad multi-size data attr', () => {
stubForAmpCreative();
sandbox.stub(impl, 'sendXhrRequest').callsFake(mockSendXhrRequest);
impl.element.setAttribute('data-multi-size', '201x50');
Expand Down Expand Up @@ -1298,8 +1293,7 @@ describes.realWin('additional amp-ad-network-doubleclick-impl',
});
});

// TODO(bradfrizzell, #14336): Fails due to console errors.
describe.skip('centering', () => {
describe('centering', () => {
const size = {width: '300px', height: '150px'};

function verifyCss(iframe, expectedSize) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,15 @@ describes.realWin('DoubleClick Fast Fetch Fluid', realWinConfig, env => {
expect(fireDelayedImpressionsSpy).to.not.be.calledOnce;
});

// TODO(glevitzky, #14336): Fails due to console errors.
it.skip('should contain sz=320x50 in ad request by default', () => {
it('should contain sz=320x50 in ad request by default', () => {
impl.initiateAdRequest();
return impl.adPromise_.then(() => {
expect(impl.adUrl_).to.be.ok;
expect(impl.adUrl_).to.match(/[&?]sz=320x50/);
});
});

// TODO(glevitzky, #14336): Fails due to console errors.
it.skip('should contain mulitple sizes in ad request', () => {
it('should contain mulitple sizes in ad request', () => {
multiSizeImpl.initiateAdRequest();
return multiSizeImpl.adPromise_.then(() => {
expect(multiSizeImpl.adUrl_).to.be.ok;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,7 @@ describes.realWin('DoubleClick Fast Fetch - Safeframe', realWinConfig, env => {
* If the safeframed creative asks to expand with invalid expand
* values, should fail gracefully.
*/
// TODO(bradfrizzell, #14336): Fails due to console errors.
it.skip('expand_request fails if invalid values sent', () => {
it('expand_request fails if invalid values sent', () => {
const expandMessage = {};
expandMessage[MESSAGE_FIELDS.CHANNEL] = safeframeHost.channel;
expandMessage[MESSAGE_FIELDS.ENDPOINT_IDENTITY] = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,21 +430,16 @@ describes.realWin('amp-ad-network-doubleclick-impl', config , env => {
it('should not send SRA request if only 1 slot is valid', () =>
executeTest([{networkId: 1234, instances: 1, invalidInstances: 2}]));

// TODO(bradfrizzell, #14336): Fails due to console errors.
it.skip('should handle xhr failure by not sending subsequent request',
it('should handle xhr failure by not sending subsequent request',
() => executeTest([{networkId: 1234, instances: 2, xhrFail: true}]));

// TODO(bradfrizzell, #14336): Fails due to console errors.
it.skip('should handle mixture of xhr and ' +
'non xhr failures', () => executeTest(
it('should handle mixture of xhr and non xhr failures', () => executeTest(
[{networkId: 1234, instances: 2, xhrFail: true}, 4567, 4567]));

it('should correctly use SRA for multiple slots. multiple networks',
() => executeTest([1234, 4567, 1234, 4567]));

// TODO(bradfrizzell, #14336): Fails due to console errors.
it.skip('should handle mixture of all ' +
'possible scenarios', () => executeTest(
it('should handle mixture of all possible scenarios', () => executeTest(
[1234, 1234, 101, {networkId: 4567, instances: 2, xhrFail: true}, 202,
{networkId: 8901, instances: 3, invalidInstances: 1}]));
});
Expand Down
7 changes: 3 additions & 4 deletions extensions/amp-ad/0.1/test/test-amp-ad-3p-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ describes.realWin('amp-ad-3p-impl', {
`${remoteUrl}?$internalRuntimeVersion$"]`)).to.be.ok;
});
});
// TODO(keithwrightbos, #14336): Fails due to console errors.
it.skip('should use default path if custom disabled', () => {

it('should use default path if custom disabled', () => {
const meta = win.document.createElement('meta');
meta.setAttribute('name', 'amp-3p-iframe-src');
meta.setAttribute('content', 'https://example.com/boot/remote.html');
Expand Down Expand Up @@ -265,8 +265,7 @@ describes.realWin('amp-ad-3p-impl', {
});
});

// TODO(keithwrightbos, #14336): Fails due to console errors.
it.skip('should not use remote html path for preload if disabled', () => {
it('should not use remote html path for preload if disabled', () => {
const meta = win.document.createElement('meta');
meta.setAttribute('name', 'amp-3p-iframe-src');
meta.setAttribute('content', 'https://example.com/boot/remote.html');
Expand Down
4 changes: 1 addition & 3 deletions extensions/amp-ad/0.1/test/test-amp-ad.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ describes.realWin('Ad loader', {amp: true}, env => {
});
});

// TODO(jridgewell, #14336): Fails due to console errors.
it.skip('fails upgrade on A4A upgrade with loadElementClass ' +
'error', () => {
it('fails upgrade on A4A upgrade with loadElementClass error', () => {
a4aRegistry['zort'] = function() {
return true;
};
Expand Down
Loading

0 comments on commit 97847f2

Please sign in to comment.