ungleich-staticcms/assets/u/static/popper.js-1.16.0/packages/popper/tests/functional/rendering.js
Nico Schottelius 16fb2bb919 import popper.js
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2019-12-31 01:21:21 +01:00

24 lines
710 B
JavaScript

import makePopperFactory from '../utils/makePopperFactory';
import makeConnectedElement from '@popperjs/test-utils/utils/makeConnectedElement';
import '@popperjs/test-utils/setup';
describe('[rendering]', () => {
const makePopper = makePopperFactory();
const microTasksAvailable = window.Promise;
it('renders to the DOM before the first paint when microtasks are available', done => {
if (!microTasksAvailable) {
pending();
}
const spy = jasmine.createSpy('paint watcher');
requestAnimationFrame(spy);
makePopper(makeConnectedElement(), makeConnectedElement(), {
onCreate: () => {
expect(spy).not.toHaveBeenCalled();
done();
},
});
});
});