Skip to content

Commit

Permalink
❄️ Unskip some tests that no longer fail (#39329)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielrozenberg authored Aug 9, 2023
1 parent 1c5e5de commit 1986291
Show file tree
Hide file tree
Showing 76 changed files with 9,781 additions and 10,184 deletions.
40 changes: 15 additions & 25 deletions ads/google/a4a/test/test-line-delimited-response-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,38 +154,28 @@ describes.sandboxed('#line-delimited-response-handler', {}, (env) => {
};
});

// TODO(lannka, #15748): Fails on Safari 11.1.0.
it.configure().skipSafari(
'should handle empty streamed response properly',
() => {
slotData = [];
setup();
return executeAndVerifyResponse();
}
);
it('should handle empty streamed response properly', () => {
slotData = [];
setup();
return executeAndVerifyResponse();
});

// TODO(lannka, #15748): Fails on Safari 11.1.0.
it.configure().skipSafari('should handle no fill response properly', () => {
it('should handle no fill response properly', () => {
slotData = [{headers: {}, creative: ''}];
setup();
return executeAndVerifyResponse();
});

// TODO(lannka, #15748): Fails on Safari 11.1.0.
it.configure().skipSafari(
'should handle multiple no fill responses properly',
() => {
slotData = [
{headers: {}, creative: ''},
{headers: {}, creative: ''},
];
setup();
return executeAndVerifyResponse();
}
);
it('should handle multiple no fill responses properly', () => {
slotData = [
{headers: {}, creative: ''},
{headers: {}, creative: ''},
];
setup();
return executeAndVerifyResponse();
});

// TODO(lannka, #15748): Fails on Safari 11.1.0.
it.configure().skipSafari('should stream properly', () => {
it('should stream properly', () => {
slotData = [
{headers: {}, creative: ''},
{
Expand Down
57 changes: 57 additions & 0 deletions examples/visual-tests/amp-form/amp-form-server-error.amp.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>AMP Form</title>
<link rel="canonical" href="amp-form.amp.html" >
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script>
<script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-0.2.js"></script>
<style amp-custom>
</style>
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
<script async src="https://cdn.ampproject.org/v0.js"></script>
</head>
<body>
<form
id="form"
method="get"
action="/404"
action-xhr="/404"
target="_blank"
custom-validation-reporting="show-all-on-submit">
<div>
<input type="text"
id="name"
name="name"
placeholder="Name..."
required
pattern="\p{L}+\s\p{L}+">
<span visible-when-invalid="valueMissing" validation-for="name"></span>
<span visible-when-invalid="patternMismatch" validation-for="name">
Please enter your first and last name separated by a space (e.g. Jane Miller)
</span>
</div>
<div>
<input type="email"
id="email"
name="email"
placeholder="Email..."
required>
<span visible-when-invalid="valueMissing" validation-for="email"></span>
<span visible-when-invalid="typeMismatch" validation-for="email"></span>
</div>
<input id="submit" type="submit" value="Submit">
<div submit-success>
<template type="amp-mustache">
Success! Thanks for trying the <code>amp-form</code> demo!
</template>
</div>
<div submit-error>
<template type="amp-mustache">
Error!
</template>
</div>
</form>
</body>
</html>
19 changes: 19 additions & 0 deletions examples/visual-tests/amp-form/amp-form-server-error.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';

const {
verifySelectorsVisible,
} = require('../../../build-system/tasks/visual-diff/verifiers');

module.exports = {
'try to submit to a dead server': async (page, name) => {
await page.tap('#name');
await page.keyboard.type('Jane Miller');
await page.tap('#email');
await page.keyboard.type('jane.miller@ampproject.org');
await page.tap('#submit');
await verifySelectorsVisible(page, name, [
'#form.user-valid',
'div[submit-error] div[id^="rendered-message-amp-form-"]',
]);
},
};
17 changes: 0 additions & 17 deletions examples/visual-tests/amp-form/amp-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,4 @@ module.exports = {
'div[submit-success] div[id^="rendered-message-amp-form-"]',
]);
},

// TODO(danielrozenberg): fix and restore this test
/*
'try to submit to a dead server': async (page, name) => {
page.on('request', interceptedRequest => interceptedRequest.abort());
await page.tap('#name');
await page.keyboard.type('Jane Miller');
await page.tap('#email');
await page.keyboard.type('jane.miller@ampproject.org');
await page.tap('#submit');
await verifySelectorsVisible(page, name, [
'#form.user-valid',
'div[submit-error] div[id^="rendered-message-amp-form-"]',
]);
}
*/
};
4 changes: 1 addition & 3 deletions extensions/amp-3d-gltf/0.1/test/test-amp-3d-gltf.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ describes.realWin(
return amp3dGltf;
};

// TODO (#16080): this test keeps timing out for some reason.
// Unskip when we figure out root cause.
it.skip('renders iframe', async () => {
it('renders iframe', async () => {
await createElement();
expect(!!doc.body.querySelector('amp-3d-gltf > iframe')).to.be.true;
});
Expand Down
3 changes: 1 addition & 2 deletions extensions/amp-a4a/0.1/test/test-amp-a4a.js
Original file line number Diff line number Diff line change
Expand Up @@ -1059,8 +1059,7 @@ describes.realWin('amp-a4a', {amp: true}, (env) => {

['', 'client_cache', 'safeframe', 'some_random_thing'].forEach(
(headerVal) => {
// TODO(wg-monetization, #25690): Fails on CI.
it.skip(`should not attach a NameFrame when header is ${headerVal}`, async () => {
it(`should not attach a NameFrame when header is ${headerVal}`, async () => {
const devStub = env.sandbox.stub(dev(), 'error');
// Make sure there's no signature, so that we go down the 3p
// iframe path.
Expand Down
23 changes: 12 additions & 11 deletions extensions/amp-access/0.1/test/test-amp-access-server-jwt.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import * as fakeTimers from '@sinonjs/fake-timers';

import {isUserErrorMessage} from '#utils/log';

import {getMode} from 'src/mode';

import * as DocumentFetcher from '../../../../src/document-fetcher';
import {removeFragment, serializeQueryString} from '../../../../src/url';
import {AccessServerJwtAdapter} from '../amp-access-server-jwt';
Expand Down Expand Up @@ -352,17 +354,16 @@ describes.realWin('AccessServerJwtAdapter', {amp: true}, (env) => {
});
});

// TODO - Restore this test, setting the development mode is not allowed.
// it.skip('should disable validation by default', () => {
// const savedDevFlag = getMode().development;
// getMode().development = false;
// const shouldBeValidatedInProdMode = adapter.shouldBeValidated_();
// getMode().development = true;
// const shouldBeValidatedInDevMode = adapter.shouldBeValidated_();
// getMode().development = savedDevFlag;
// expect(shouldBeValidatedInProdMode).to.be.false;
// expect(shouldBeValidatedInDevMode).to.be.true;
// });
it('should disable validation by default', () => {
const savedDevFlag = getMode().development;
getMode().development = false;
const shouldBeValidatedInProdMode = adapter.shouldBeValidated_();
getMode().development = true;
const shouldBeValidatedInDevMode = adapter.shouldBeValidated_();
getMode().development = savedDevFlag;
expect(shouldBeValidatedInProdMode).to.be.false;
expect(shouldBeValidatedInDevMode).to.be.true;
});

it('should fetch JWT', () => {
const authdata = {};
Expand Down
Loading

0 comments on commit 1986291

Please sign in to comment.