mirror of
https://github.com/marko-js/marko.git
synced 2026-01-25 15:03:04 +00:00
* enable legacy hydrate tests, update test harness to support legacy widgets * enable autokey for tests, update expectations, add better html diff output * update test harness to register statically discovered components * return to using a single mount function for legacy and modern components * remove lasso from test package dependencies * add all renders to the renderedCache, track instances separately * temporarily skip failing hydrate test for widget types * update widget lifecycle tracker to work with hydrate test as well * update tests/expectations to use serialize globals: onCreate should be called when hydrating stateful components * preserve included renderbodies * update legacy renderbodies to use the new method of preservations * mount components in preserved renderbodies * stateful components should rerender when mounting, not all legacy components are split components * ensure elements with events in split components have thier keys serialized * call onCreate and onInput when mounting root rerender components * fix code supporting once-* causing all events (on-* included) for hydrated split components to be handled only once * change the way input is removed from legacy components
17 lines
630 B
JavaScript
17 lines
630 B
JavaScript
var expect = require('chai').expect;
|
|
|
|
module.exports = function (helpers) {
|
|
var component = helpers.mount(require.resolve('./index'), {});
|
|
// var rootEl = component.el;
|
|
var helloComponent = component.getComponent('hello');
|
|
expect(component.getEl('root').querySelector('.hello') != null).to.equal(true);
|
|
// expect(helloComponent.el.parentNode).to.equal(rootEl);
|
|
|
|
component.state.insertEl = true;
|
|
component.state.count++;
|
|
component.update();
|
|
|
|
expect(component.getEl('root').querySelector('.hello') != null).to.equal(true);
|
|
|
|
expect(component.getComponent('hello')).to.equal(helloComponent);
|
|
}; |