It is possible to create a unit test that can test ui aspects? here is an example:
addMessage = function (type, message) {
//success, error, info, block(alert)
$("body").append('<div id="messageCenter" class="alert alert-' + type + '" style="position: fixed; top: 0; width: 100%; text-align:center;">' + message + '</div>');
setTimeout(function () {
$("#messageCenter").fadeOut(500, function () {
$("#messageCenter").remove();
});
}, 10000);
}
This creates a message bar at the top of the page to show the user some information. Can someone help me with an example of the unit test for this function? Thanks in advance.