reshow-return
Version:
reshow-return (simple connect component with reshow-flux)
23 lines (22 loc) • 677 B
JavaScript
// @ts-check
import { expect } from "chai";
import { render } from "reshow-unit";
import { createReducer } from "reshow-flux-base";
import * as React from "react";
import useClientReturn from "../useClientReturn.mjs";
import { jsx as _jsx } from "react/jsx-runtime";
describe("Test useClientReturn", function () {
it("basic test", function () {
var [store] = createReducer(function (_state, action) {
return action;
}, {
foo: "bar"
});
var Dom = function Dom() {
var state = useClientReturn(["foo"], store);
return state.foo;
};
var wrap = render(/*#__PURE__*/_jsx(Dom, {}));
expect(wrap.html()).to.equal("bar");
});
});