mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
18 lines
581 B
JavaScript
18 lines
581 B
JavaScript
var expect = require('chai').expect;
|
|
|
|
module.exports = function(helpers) {
|
|
var widgetsLookup = {};
|
|
window.addWidget = function(name, widget) {
|
|
var widgets = widgetsLookup[name] || (widgetsLookup[name] = []);
|
|
widgets.push(widget);
|
|
};
|
|
|
|
var widget = helpers.mount(require('./index'), {});
|
|
|
|
expect(widgetsLookup['app-nested-widget-bind/foo'].length).to.equal(1);
|
|
expect(widgetsLookup['app-nested-widget-bind/bar'].length).to.equal(1);
|
|
|
|
expect(widgetsLookup['app-nested-widget-bind/foo'][0]).to.equal(widget);
|
|
|
|
delete window.addWidget;
|
|
}; |