organism-react-scroll-nav
Version:
A React scroll spy library with flux
26 lines • 931 B
JavaScript
import _asyncToGenerator from "reshow-runtime/es/helpers/asyncToGenerator";
var _div;
import { expect } from "chai";
import { render, sleep, act, waitFor } from "reshow-unit";
import ScrollReceiver from "../ScrollReceiver.mjs";
import ScrollSpy from "../ScrollSpy.mjs";
import { jsx as _jsx } from "react/jsx-runtime";
describe("Test ScrollReceiver", function () {
var _ScrollSpy;
var TestEl = function TestEl() {
return _div || (_div = /*#__PURE__*/_jsx("div", {}));
};
it("test simple ScrollReceiver", /*#__PURE__*/_asyncToGenerator(function* () {
var vDom = _ScrollSpy || (_ScrollSpy = /*#__PURE__*/_jsx(ScrollSpy, {
children: /*#__PURE__*/_jsx(ScrollReceiver, {
container: TestEl
})
}));
var wrap = render(vDom);
act(undefined, 500);
yield sleep(function () {}, 350);
yield waitFor(function () {
expect(wrap.html()).to.have.string("<div></div>");
});
}));
});