forked from Meteor-Community-Packages/meteor-scss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.js
55 lines (39 loc) · 1.4 KB
/
tests.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Tinytest.add("sass/scss - imports", function (test) {
var div = document.createElement('div');
document.body.appendChild(div);
var prefixes = ['scss'];
try {
var t = function (className, style) {
prefixes.forEach(function(prefix){
div.className = prefix + '-' + className;
// Read 'border-top-style' instead of 'border-style' (which is set
// by the stylesheet) because only the individual styles are computed
// and can be retrieved. Trying to read the synthetic 'border-style'
// gives an empty string.
test.equal(getStyleProperty(div, 'border-top-style'), style, div.className);
});
};
t('el1', 'dotted');
t('el2', 'dashed');
t('el3', 'solid');
t('el4', 'double');
t('el5', 'groove');
t('el6', 'inset');
// This is assigned to 'ridge' in not-included.s(a|c)ss, which is ... not
// included. So that's why it should be 'none'. (This tests that we don't
// process non-main files.)
t('el0', 'none');
} finally {
document.body.removeChild(div);
}
});
Tinytest.add('sass/scss - import from includePaths', function (test) {
var div = document.createElement('div');
document.body.appendChild(div);
try {
div.className = 'from-include-paths';
test.equal(getStyleProperty(div, 'border-bottom-style'), 'outset', div.className);
} finally {
document.body.removeChild(div);
}
});