forked from muicss/mui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-util.js
More file actions
39 lines (26 loc) · 831 Bytes
/
test-util.js
File metadata and controls
39 lines (26 loc) · 831 Bytes
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
/**
* MUI Test Util library
* @module test/cssjs-tests/test-util
*/
var assert = require('assert');
var util = require('../../src/js/lib/util.js');
describe('js/lib/util.js', function() {
var el;
beforeEach(function() {
el = document.createElement('div');
document.body.appendChild(el);
});
afterEach(function() {
el.parentNode.removeChild(el);
});
// --------------------------------------------------------------------------
// LOADSTYLE
// --------------------------------------------------------------------------
it('should load styles dynamically', function() {
var s = '.my-class {color: rgb(255, 0, 0);}';
util.loadStyle(s);
el.className = 'my-class';
var css = getComputedStyle(el);
assert.equal(css.getPropertyValue('color'), 'rgb(255, 0, 0)');
});
});