Merge pull request #800 from ing-bank/chore/flaky-tests

chore: fix flaky test, prevent unhandled promise undefined feedbackNode
This commit is contained in:
Thijs Louisse 2020-07-06 18:13:08 +02:00 committed by GitHub
commit d5a6a8df09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 18 deletions

View file

@ -622,8 +622,7 @@ describe('<lion-fieldset>', () => {
const spyB = sinon.spy(childB, 'initInteractionState');
expect(fieldset.prefilled).to.be.false;
expect(fieldset.dirty).to.be.false;
await fieldset.registrationReady;
await nextFrame();
await fieldset.registrationComplete;
expect(spyA).to.have.been.called;
expect(spyB).to.have.been.called;
expect(fieldset.prefilled).to.be.true;

View file

@ -544,6 +544,10 @@ export const ValidateMixin = dedupeMixin(
* - we set aria-invalid="true" in case hasErrorVisible is true
*/
_updateFeedbackComponent() {
if (!this._feedbackNode) {
return;
}
if (!this.__feedbackQueue) {
this.__feedbackQueue = new AsyncQueue();
}

View file

@ -517,7 +517,7 @@ export class OverlayController {
const event = new CustomEvent('before-hide', { cancelable: true });
this.dispatchEvent(event);
if (!event.defaultPrevented) {
// await this.transitionHide({ backdropNode: this.backdropNode, conentNode: this.contentNode });
// await this.transitionHide({ backdropNode: this.backdropNode, contentNode: this.contentNode });
this._contentWrapperNode.style.display = 'none';
this._handleFeatures({ phase: 'hide' });
this._keepBodySize({ phase: 'hide' });

View file

@ -30,11 +30,16 @@ export function runOverlayMixinSuite({ tagString, tag, suffix = '' }) {
`);
el.opened = true;
expect(el.opened).to.be.true;
await el.updateComplete;
if (el.repositionComplete) {
await el.repositionComplete;
}
await nextFrame(); // overlayCtrl show/hide is async
expect(el._overlayCtrl.isShown).to.be.true;
el.opened = false;
expect(el.opened).to.be.false;
await el.updateComplete;
await nextFrame(); // overlayCtrl show/hide is async
expect(el._overlayCtrl.isShown).to.be.false;
});

View file

@ -1,4 +1,5 @@
export default {
sessionStartTimeout: 30000,
coverage: process.argv.includes('--coverage')
? {
thresholds: {

View file

@ -2513,20 +2513,6 @@
mocha "^6.2.2"
sinon-chai "^3.3.0"
"@polymer/iron-test-helpers@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@polymer/iron-test-helpers/-/iron-test-helpers-3.0.1.tgz#ec2b9c6567e2967a191b3d800a04b1167b2d1394"
integrity sha512-2R7dnGcW2eg95i7LhYWWUO4AlAk6qXsPnKoyeN2R1t0km0ECMx0jjwqeLwCo8/7LwuVPZSiarI4DK7jyU7fJLQ==
dependencies:
"@polymer/polymer" "^3.0.0"
"@polymer/polymer@^3.0.0":
version "3.4.1"
resolved "https://registry.yarnpkg.com/@polymer/polymer/-/polymer-3.4.1.tgz#333bef25711f8411bb5624fb3eba8212ef8bee96"
integrity sha512-KPWnhDZibtqKrUz7enIPOiO4ZQoJNOuLwqrhV2MXzIt3VVnUVJVG5ORz4Z2sgO+UZ+/UZnPD0jqY+jmw/+a9mQ==
dependencies:
"@webcomponents/shadycss" "^1.9.1"
"@reach/router@^1.2.1":
version "1.3.4"
resolved "https://registry.yarnpkg.com/@reach/router/-/router-1.3.4.tgz#d2574b19370a70c80480ed91f3da840136d10f8c"
@ -3248,7 +3234,7 @@
"@web/test-runner-mocha" "^0.1.2"
command-line-args "^5.1.1"
"@webcomponents/shadycss@^1.9.1", "@webcomponents/shadycss@^1.9.4":
"@webcomponents/shadycss@^1.9.4":
version "1.10.0"
resolved "https://registry.yarnpkg.com/@webcomponents/shadycss/-/shadycss-1.10.0.tgz#7a80ec1e8b271fb3f0cc02cd4358b877a303545d"
integrity sha512-UMS+dF4DXDrcUmQqK6aLd/3mFyfGktKG/hZR6FtrsQK/INO07G0H8FxElLkuvHj0iePeZGpR7R4lWFTvX7rc9g==