mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 23:16:52 +08:00
List items with or without binding
This commit is contained in:
@ -1,17 +1,38 @@
|
||||
describe('Ionic Modal', function() {
|
||||
var modal, q;
|
||||
|
||||
beforeEach(module('ionic.ui.modal'));
|
||||
beforeEach(module('ionic.service.modal'));
|
||||
|
||||
beforeEach(inject(function(Modal, $q) {
|
||||
beforeEach(inject(function(Modal, $q, $templateCache) {
|
||||
q = $q;
|
||||
modal = Modal;
|
||||
|
||||
$templateCache.put('modal.html', '<div class="modal"></div>');
|
||||
}));
|
||||
|
||||
iit('Should show', function() {
|
||||
it('Should show for static template', function() {
|
||||
var template = '<div class="modal"></div>';
|
||||
var deferred = q.defer();
|
||||
modal.fromTemplate(template);
|
||||
deferred.resolve(true);
|
||||
var modalInstance = modal.fromTemplate(template);
|
||||
modalInstance.show();
|
||||
expect(modalInstance.el.classList.contains('modal')).toBe(true);
|
||||
expect(modalInstance.el.classList.contains('active')).toBe(true);
|
||||
});
|
||||
|
||||
iit('Should show for dynamic template', function() {
|
||||
var template = '<div class="modal"></div>';
|
||||
|
||||
var done = false;
|
||||
|
||||
var modalInstance = modal.fromTemplateUrl('modal.html', function(modalInstance) {
|
||||
done = true;
|
||||
modalInstance.show();
|
||||
expect(modalInstance.el.classList.contains('modal')).toBe(true);
|
||||
expect(modalInstance.el.classList.contains('active')).toBe(true);
|
||||
});
|
||||
|
||||
waitsFor(function() {
|
||||
return done;
|
||||
}, "Modal should be loaded", 100);
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user