mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
21 lines
668 B
JavaScript
21 lines
668 B
JavaScript
var expect = require('chai').expect;
|
|
|
|
module.exports = function(helpers) {
|
|
var widget = helpers.mount(require('./index'), {
|
|
name: 'Frank'
|
|
});
|
|
|
|
var buttonWidget = widget.getWidget('button');
|
|
expect(buttonWidget.el.innerHTML).to.contain('Frank');
|
|
expect(buttonWidget.el.className).to.equal('app-button app-button-small');
|
|
|
|
widget.input = { name: 'John '};
|
|
widget.update();
|
|
|
|
expect(buttonWidget.el.innerHTML).to.contain('John');
|
|
|
|
buttonWidget.setSize('large');
|
|
buttonWidget.update();
|
|
expect(buttonWidget.el.innerHTML).to.contain('John');
|
|
expect(buttonWidget.el.className).to.equal('app-button app-button-large');
|
|
}; |