Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test("should not call adjust if disabled by the options", () => {
const containerElement = {
parentNode: document.createElement("div")
};
const meta = {};
new Container(containerElement, meta, {
adjustOnResize: false,
adjustOnInstantiation: false
});
expect(ResizeObserver).toHaveBeenCalledTimes(1);
expect(ResizeObserver.prototype.observe).toHaveBeenCalledTimes(0);
expect(raf).toHaveBeenCalledTimes(0);
expect(processMeta).toHaveBeenCalledTimes(1);
expect(processMeta.mock.calls[0][0]).toBe(meta);
expect(adjustContainer).toHaveBeenCalledTimes(0);
});
beforeEach(() => {
raf.mockClear();
processMeta.mockClear();
adjustContainer.mockClear();
ResizeObserver.prototype.observe.mockClear();
ResizeObserver.prototype.unobserve.mockClear();
containerRegistry.get.mockClear();
containerRegistry.set.mockClear();
containerRegistry.has.mockClear();
containerRegistry.delete.mockClear();
});