Add unit tests for custom tabs and modal titles

This commit is contained in:
Andy Armstrong
2014-04-03 12:02:48 -04:00
parent 5ab159b079
commit b779b8a6fb
6 changed files with 111 additions and 43 deletions

View File

@@ -40,8 +40,17 @@ define(["jquery", "js/spec_helpers/create_sinon", "js/views/modals/edit_xblock",
return modal;
};
isShowingModal = function() {
return $('.wrapper-modal-window').length > 0;
isShowingModal = function(modal) {
var modalElement;
if (modal) {
modalElement = modal.$el;
} else {
modalElement = $('.wrapper-modal-window');
}
if (modalElement) {
return modalElement.hasClass('is-shown');
}
return false;
};
cancelModal = function(modal) {