14 changed files with 208 additions and 142 deletions
Split View
Diff Options
-
3package.json
-
42spec/module.commented.js
-
2src/modules/accordion.js
-
7src/modules/dimmer.js
-
2src/modules/dropdown.js
-
10src/modules/modal.js
-
2src/modules/popup.js
-
2src/modules/sidebar.js
-
2src/modules/video.js
-
17test/helpers/jasmine-clog.js
-
28test/helpers/jquery-events.js
-
68test/karma.conf.js
-
11test/modules/modal.js
-
154test/modules/modal.spec.js
@ -0,0 +1,17 @@ |
|||
// Allow for console.log to not break IE
|
|||
if (typeof window.console == "undefined" || typeof window.console.log == "undefined") { |
|||
window.console = { |
|||
log : function() {}, |
|||
info : function(){}, |
|||
warn : function(){} |
|||
}; |
|||
} |
|||
if(typeof window.console.group == 'undefined' || typeof window.console.groupEnd == 'undefined' || typeof window.console.groupCollapsed == 'undefined') { |
|||
window.console.group = function(){}; |
|||
window.console.groupEnd = function(){}; |
|||
window.console.groupCollapsed = function(){}; |
|||
} |
|||
if(typeof window.console.markTimeline == 'undefined') { |
|||
window.console.markTimeline = function(){}; |
|||
} |
|||
window.console.clear = function(){}; |
@ -0,0 +1,28 @@ |
|||
(function($) { |
|||
$.events = function(selector, root) { |
|||
var s = []; |
|||
$(selector || '*', root).addBack().each(function() { |
|||
// the following line is the only change
|
|||
var e = $._data(this, 'events'); |
|||
if(!e) return; |
|||
s.push(this.tagName); |
|||
if(this.id) s.push('#', this.id); |
|||
if(this.className) s.push('.', this.className.replace(/ +/g, '.')); |
|||
for(var p in e) { |
|||
var r = e[p], |
|||
h = r.length - r.delegateCount; |
|||
if(h) |
|||
s.push('\n', h, ' ', p, ' handler', h > 1 ? 's' : ''); |
|||
if(r.delegateCount) { |
|||
for(var q = 0; q < r.length; q++) |
|||
if(r[q].selector) s.push('\n', p, ' for ', r[q].selector); |
|||
} |
|||
} |
|||
s.push('\n\n'); |
|||
}); |
|||
return s.join(''); |
|||
} |
|||
$.fn.events = function(selector) { |
|||
return $.events(selector, this); |
|||
} |
|||
})(jQuery); |
@ -1,68 +0,0 @@ |
|||
// Karma configuration
|
|||
module.exports = function(config) { |
|||
config.set({ |
|||
|
|||
// base path, that will be used to resolve files and exclude
|
|||
basePath: '', |
|||
|
|||
// frameworks to use
|
|||
frameworks: [ |
|||
'jasmine' |
|||
], |
|||
|
|||
// list of files / patterns to load in the browser
|
|||
files: [ |
|||
// require jquery
|
|||
'../server/files/javascript/library/jquery.js', |
|||
// read css from compiled css
|
|||
'../docs/build/**/*.css', |
|||
// read js from src js
|
|||
'../src/**/*.js', |
|||
// require helpers
|
|||
'helpers/*.js', |
|||
// require tests
|
|||
'modules/*.js' |
|||
], |
|||
|
|||
// list of files to exclude
|
|||
exclude: [ |
|||
'**/*.swp', |
|||
'karma.conf.js' |
|||
], |
|||
|
|||
// test results reporter to use
|
|||
// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
|
|||
reporters: ['spec'], |
|||
|
|||
// web server port
|
|||
port: 9999, |
|||
|
|||
// enable / disable colors in the output (reporters and logs)
|
|||
colors: true, |
|||
|
|||
// level of logging
|
|||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
|||
logLevel: config.LOG_INFO, |
|||
|
|||
// enable / disable watching file and executing tests whenever any file changes
|
|||
autoWatch: true, |
|||
|
|||
// Start these browsers, currently available:
|
|||
// - Chrome
|
|||
// - ChromeCanary
|
|||
// - Firefox
|
|||
// - Opera
|
|||
// - Safari (only Mac)
|
|||
// - PhantomJS
|
|||
// - IE (only Windows)
|
|||
browsers: ['PhantomJS'], |
|||
|
|||
|
|||
// If browser does not capture in given timeout [ms], kill it
|
|||
captureTimeout: 60000, |
|||
|
|||
// Continuous Integration mode
|
|||
// if true, it capture browsers, run tests and exit
|
|||
singleRun: false |
|||
}); |
|||
}; |
@ -1,11 +0,0 @@ |
|||
describe("UI Modal", function() { |
|||
|
|||
it("contains spec with an expectation", function() { |
|||
expect(true).toBe(true); |
|||
}); |
|||
|
|||
it("contains another spec with another expectation", function() { |
|||
expect(true).toBe(true); |
|||
}); |
|||
|
|||
}); |
Write
Preview
Loading…
Cancel
Save