organism-react-scroll-animate
Version:
36 lines (35 loc) • 1.18 kB
JavaScript
import _classCallCheck from "reshow-runtime/es/helpers/classCallCheck";
import _createClass from "reshow-runtime/es/helpers/createClass";
//@ts-check
/**
* @typedef {import("mocha")}
*/
import { render, getSinon } from "reshow-unit";
import { expect } from "chai";
import useIntersectionObserver from "../useIntersectionObserver.mjs";
import { jsx as _jsx } from "react/jsx-runtime";
describe("test useIntersectionObserver", function () {
before(function () {
var IntersectionObserver = /*#__PURE__*/function () {
function IntersectionObserver() {
_classCallCheck(this, IntersectionObserver);
}
_createClass(IntersectionObserver, [{
key: "observe",
value: function observe() {}
}, {
key: "unobserve",
value: function unobserve() {}
}]);
return IntersectionObserver;
}();
window.IntersectionObserver = getSinon().spy(IntersectionObserver);
});
it("basic test", function () {
var Comp = function Comp() {
return useIntersectionObserver("div", function () {});
};
var wrap = render( /*#__PURE__*/_jsx(Comp, {}));
expect(wrap.html()).to.equal("<div></div>");
});
});