-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
node CSS class attributes metric (to be used for similarity analysis …
…between snapshots)
- Loading branch information
1 parent
8af2a1b
commit ddcc33c
Showing
3 changed files
with
77 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
( function( window, QUnit ) { | ||
|
||
"use strict"; | ||
|
||
var testCanvas = document.getElementById('testCanvas'); | ||
|
||
QUnit.module("Layoutstats Node Metrics", { | ||
beforeEach: function () { | ||
|
||
}, | ||
afterEach: function () { | ||
// we empty the testcanvas | ||
testCanvas.innerHTML = ''; | ||
} | ||
}); | ||
|
||
function injectAndGetLayoutStats(htmlStr){ | ||
testCanvas.innerHTML = htmlStr; | ||
return layoutstats(testCanvas); | ||
} | ||
|
||
QUnit.test("measures the css class attributes used by child nodes. It ", function (assert) { | ||
var ls = injectAndGetLayoutStats('<div class="foo1 foo2 foo3"></div><span class="foo1 foo2 foo3"></span><div class="bar1 bar2 bar2"></div>'); | ||
assert.deepEqual(ls.nodeUsedCSSClassAttributesList.sort(),["foo1 foo2 foo3", "bar1 bar2 bar2"].sort(),"creates an array of unique class list combinations"); | ||
}); | ||
|
||
})( window, QUnit ); |