Skip to content

Commit 82341fa

Browse files
committed
Changed tab spacing to 2 and spaces
2 parents 30b2e1d + da6e8aa commit 82341fa

File tree

10 files changed

+177
-13
lines changed

10 files changed

+177
-13
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ node_modules/
1010
bin/jquery-2.1.1.min.js
1111
/.idea/
1212
**/*.log
13+
bower_components

Gruntfile.js

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,51 @@ module.exports = function(grunt) {
479479
// see below for options. this is optional.
480480
}
481481
}
482+
},
483+
// Testem
484+
testem: {
485+
'default': {
486+
src: [
487+
'bower_components/qunit/qunit/qunit.js',
488+
'bower_components/jquery/dist/jquery.min.js',
489+
'js/jquery.easing.1.3.js',
490+
'js/animation.js',
491+
'js/velocity.min.js',
492+
'js/hammer.min.js',
493+
'js/jquery.hammer.js',
494+
'js/global.js',
495+
'js/collapsible.js',
496+
'js/dropdown.js',
497+
'js/leanModal.js',
498+
'js/materialbox.js',
499+
'js/parallax.js',
500+
'js/tabs.js',
501+
'js/tooltip.js',
502+
'js/waves.js',
503+
'js/toasts.js',
504+
'js/sideNav.js',
505+
'js/scrollspy.js',
506+
'js/forms.js',
507+
'js/slider.js',
508+
'js/cards.js',
509+
'js/pushpin.js',
510+
'js/buttons.js',
511+
'js/transitions.js',
512+
'js/scrollFire.js',
513+
'js/date_picker/picker.js',
514+
'js/date_picker/picker.date.js',
515+
'js/character_counter.js',
516+
'tests/setup.js',
517+
'tests/helpers/**/*.js',
518+
'tests/**/*-test.js'
519+
],
520+
options: {
521+
framework: "qunit",
522+
test_page: 'tests/index.mustache?hidepassed',
523+
launch_in_dev: ['PhantomJS', 'Chrome', 'Firefox'],
524+
}
482525
}
526+
}
483527

484528
});
485529

@@ -500,7 +544,7 @@ module.exports = function(grunt) {
500544
grunt.loadNpmTasks('grunt-rename');
501545
grunt.loadNpmTasks("grunt-remove-logging");
502546
grunt.loadNpmTasks('grunt-browser-sync');
503-
547+
grunt.loadNpmTasks('grunt-contrib-testem');
504548
// define the tasks
505549
grunt.registerTask(
506550
'release',[

bower.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,11 @@
5858
"sitemap.xml",
5959
"package.json",
6060
"Gruntfile.js"
61-
6261
],
6362
"dependencies": {
64-
"jquery": ">=2.1.1"
65-
}
63+
"jquery": ">=2.1.1"
64+
},
65+
"devDependencies": {
66+
"qunit": "~1.18.0"
67+
}
6668
}

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,33 @@
88
"type": "git",
99
"url": "git://github.com/Dogfalo/materialize.git"
1010
},
11-
"dependencies": {
12-
},
1311
"directories" : {
1412
"sass": "sass",
1513
"bin": "bin",
1614
"font": "font"
1715
},
16+
"dependencies": {},
1817
"engine": "node >= 0.10",
1918
"devDependencies": {
20-
"node-sass": "^2.1.1",
2119
"grunt": "^0.4.5",
2220
"grunt-banner": "^0.3.0",
2321
"grunt-browser-sync": "^2.1.1",
22+
"grunt-concurrent": "^1.0.0",
2423
"grunt-contrib-clean": "0.5.x",
24+
"grunt-contrib-compress": "^0.12.0",
25+
"grunt-contrib-concat": "^0.5.0",
2526
"grunt-contrib-connect": "^0.4.2",
2627
"grunt-contrib-copy": "0.4.x",
2728
"grunt-contrib-cssmin": "0.6.x",
2829
"grunt-contrib-jade": "0.8.x",
30+
"grunt-contrib-testem": "^0.5.16",
2931
"grunt-contrib-uglify": "0.2.x",
30-
"grunt-sass": "^0.18.1",
31-
"grunt-contrib-concat": "^0.5.0",
32-
"grunt-contrib-compress": "^0.12.0",
3332
"grunt-contrib-watch": "^0.5.3",
34-
"grunt-concurrent": "^1.0.0",
3533
"grunt-notify": "^0.4.1",
36-
"grunt-text-replace": "^0.4.0",
34+
"grunt-remove-logging": "^0.2.0",
3735
"grunt-rename": "^0.1.4",
38-
"grunt-remove-logging": "^0.2.0"
36+
"grunt-sass": "^0.18.1",
37+
"grunt-text-replace": "^0.4.0",
38+
"node-sass": "^2.1.1"
3939
}
4040
}

tests/collapsible-test.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module('collapsible tests', {
2+
setup: function() {
3+
setupPage('collapsible');
4+
$('.collapsible').collapsible({
5+
accordion: false // A setting that changes the collapsible behavior to expandable instead of the default accordion style
6+
});
7+
}
8+
});
9+
10+
QUnit.test('basic collapsible test', function(assert) {
11+
// Async mode
12+
QUnit.stop();
13+
14+
// Starting condition
15+
QUnit.equal($('.collapsible li:first-child .collapsible-body').css('display'), 'block', 'First accordion is displayed initially');
16+
17+
setTimeout(function() {
18+
QUnit.start(); // Test is done once we reach end of this scope
19+
20+
// Ensure the first accordion starts collapsed
21+
QUnit.equal($('.collapsible li:first-child .collapsible-body').css('display'), 'none', 'First accordion is hidden after at least 350ms');
22+
23+
// Click the header
24+
$('.collapsible li:first-child .collapsible-header').click();
25+
26+
// Now the first accordion should be opened
27+
QUnit.equal($('.collapsible li:first-child .collapsible-header').css('display'), 'block', 'First accordion is displayed');
28+
}, 350);
29+
});
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* The MIT License (MIT)
3+
* Copyright (c) 2015 ember-cli
4+
*
5+
* see: https://github.com/ember-cli/ember-cli-qunit/commit/2603576ee98933eecabae8f9454f397af3fd5a5f
6+
*/
7+
#materialize-testing-container {
8+
position: relative;
9+
background: white;
10+
bottom: 0;
11+
right: 0;
12+
width: 640px;
13+
height: 384px;
14+
overflow: auto;
15+
z-index: 9999;
16+
border: 1px solid #ccc;
17+
margin: 0 auto;
18+
}
19+
#materialize-testing {
20+
zoom: 50%;
21+
}

tests/helpers/helpers.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
function setupPage(pageName) {
2+
return $.ajax('/tests/pages/' + pageName + '.html',{
3+
async: false
4+
}).then(function (html) {
5+
document.getElementById('materialize-testing-container').innerHTML = html;
6+
});
7+
}
8+
9+
window.setupPage = setupPage;

tests/index.mustache

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>QUnit Example</title>
6+
{{#serve_files}}
7+
<script src="{{src}}"></script>
8+
{{/serve_files}}
9+
<link rel="stylesheet" href="/bower_components/qunit/qunit/qunit.css">
10+
<link rel="stylesheet" href="/tests/css/testing-container-styles.css">
11+
</head>
12+
<body>
13+
<div id="qunit"></div>
14+
<div id="qunit-fixture"></div>
15+
<div id="materialize-testing-container"></div>
16+
</body>
17+
</html>

tests/pages/collapsible.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<ul class="collapsible" data-collapsible="accordion">
2+
<li>
3+
<div class="collapsible-header"><i class="mdi-image-filter-drama"></i>First</div>
4+
<div class="collapsible-body"><p>Lorem ipsum dolor sit amet.</p></div>
5+
</li>
6+
<li>
7+
<div class="collapsible-header"><i class="mdi-maps-place"></i>Second</div>
8+
<div class="collapsible-body"><p>Lorem ipsum dolor sit amet.</p></div>
9+
</li>
10+
<li>
11+
<div class="collapsible-header"><i class="mdi-social-whatshot"></i>Third</div>
12+
<div class="collapsible-body"><p>Lorem ipsum dolor sit amet.</p></div>
13+
</li>
14+
</ul>

tests/setup.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* The MIT License (MIT)
3+
* Copyright (c) 2015 ember-cli
4+
*
5+
* see: https://github.com/ember-cli/ember-cli-qunit/blob/b46c5e7d1abfeadfd0309e6c4b4082ebe3b58896/vendor/ember-cli-qunit/qunit-configuration.js
6+
*/
7+
8+
QUnit.config.urlConfig.push({ id: 'nocontainer', label: 'Hide container'});
9+
QUnit.config.urlConfig.push({ id: 'dockcontainer', label: 'Dock container'});
10+
QUnit.config.testTimeout = 60000; //Default Test Timeout 60 Seconds
11+
12+
function setupTestingContainer() {
13+
var testContainer = document.getElementById('materialize-testing-container');
14+
var containerVisibility = QUnit.urlParams.nocontainer ? 'hidden' : 'visible';
15+
var containerPosition = QUnit.urlParams.dockcontainer ? 'absolute' : 'relative';
16+
17+
testContainer.style.visibility = containerVisibility;
18+
testContainer.style.position = containerPosition;
19+
}
20+
21+
QUnit.begin(function() {
22+
setupTestingContainer();
23+
});
24+
25+
QUnit.moduleDone(function () {
26+
document.getElementById('materialize-testing-container').innerHTML = '';
27+
});

0 commit comments

Comments
 (0)