Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

Commit

Permalink
Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stevezhu committed Sep 2, 2014
1 parent 0af63d0 commit 4610ad9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
10 changes: 10 additions & 0 deletions package.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,13 @@ Package._transitional_registerBuildPlugin({
'lodash': '2.4.1'
}
});

Package.onTest(function(api) {
api.use(['test-helpers', 'tinytest']);
api.use(['ui', 'templating', 'stevezhu:sass']);
api.addFiles([
'tests/test.scss',
'tests/test.html',
'tests/test.js'
], 'client');
});
3 changes: 3 additions & 0 deletions tests/test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<template name="testTemplate">
<div id="test-elem"></div>
</template>
9 changes: 9 additions & 0 deletions tests/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Tinytest.add("Sass - Is working", function(test) {
var renderedTemplate = UI.render(Template.testTemplate);
UI.insert(renderedTemplate, document.body);

var elem = document.getElementById('test-elem');
test.equal(getStyleProperty(elem, 'display'), 'none', "Expected display: none;")

UI.remove(renderedTemplate);
});
3 changes: 3 additions & 0 deletions tests/test.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#test-elem {
display: none;
}

0 comments on commit 4610ad9

Please sign in to comment.