import * as assert from 'power-assert' import { delay, minify } from './utils' import { atto } from '../src/atto' import { Context } from '../src/Context' import { x } from '../src/x' beforeEach(() => { document.body.innerHTML = '' }) test('Slice context', async () => { const view = ({ xa: { context }, ...props }, children) => (
) const Child: any = ({ xa: { context }, ...props }, children) => (
{context.name}
{context.children && context.children.length && ()}
) const Children: any = ({ xa: { context }, ...props }, children) => ( ) const mutate = atto(view, document.body) mutate({ name: "foo", children: [ { name: "bar", children: [ { name: "bar child" } ] }, { name: "baz", children: [ { name: "baz child" } ] } ] }) await delay(10) const html = minify`
foo
` assert(document.body.innerHTML == html) })