flectra/addons/web/static/tests/widgets/rainbow_man_tests.js
2018-01-16 02:34:37 -08:00

38 lines
975 B
JavaScript

flectra.define('web.rainbow_man_tests', function (require) {
"use strict";
var RainbowMan = require('web.rainbow_man');
QUnit.module('widgets', {}, function () {
QUnit.module('RainbowMan', {
beforeEach: function () {
this.data = {
message: 'Congrats!',
click_close: false
};
},
}, function () {
QUnit.test("rendering a rainbowman", function (assert) {
assert.expect(2);
var $target = $("#qunit-fixture");
// Create and display rainbowman
var rainbowman = new RainbowMan(this.data);
rainbowman.appendTo($target);
var $rainbow = rainbowman.$(".o_reward_rainbow");
assert.strictEqual($rainbow.length, 1,
"Should have displayed rainbow effect");
assert.ok(rainbowman.$('.o_reward_msg_content').html() === 'Congrats!',
"Card on the rainbowman should display 'Congrats!' message");
rainbowman.destroy();
});
});
});
});