Skip to content

Commit

Permalink
test: wait for animation frame to fix flaky ResizeMixin tests (#5347) (
Browse files Browse the repository at this point in the history
…#5487)

Co-authored-by: Tomi Virkki <tomivirkki@users.noreply.github.com>
  • Loading branch information
web-padawan and tomivirkki committed Feb 7, 2023
1 parent 29392db commit 8045b03
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/component-base/test/resize-mixin.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@esm-bundle/chai';
import { aTimeout, fixtureSync } from '@vaadin/testing-helpers';
import { aTimeout, fixtureSync, nextFrame } from '@vaadin/testing-helpers';
import sinon from 'sinon';
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
import { ResizeMixin } from '../src/resize-mixin.js';
Expand Down Expand Up @@ -97,10 +97,13 @@ describe('resize-mixin', () => {
describe('multiple children', () => {
let sibling, spy1, spy2;

beforeEach(() => {
beforeEach(async () => {
sibling = element.cloneNode(true);
parent.appendChild(sibling);

await nextFrame();
await nextFrame();

spy1 = sinon.spy(element, '_onResize');
spy2 = sinon.spy(sibling, '_onResize');
});
Expand Down

0 comments on commit 8045b03

Please sign in to comment.