Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: wait for animation frame to fix flaky ResizeMixin tests (#5347) (CP: 23.2) #5487

Merged
merged 1 commit into from
Feb 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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