Skip to content

Commit cb44261

Browse files
committed
Update tests for 'isEqual' method
1 parent 091b114 commit cb44261

3 files changed

Lines changed: 35 additions & 1 deletion

File tree

test/fixtures/9.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head lang="en">
4+
<meta charset="UTF-8">
5+
<title></title>
6+
</head>
7+
<body>
8+
<label for="random">label for input</label>
9+
<input id="random">
10+
<div onclick="return {&quot;a&quot;:{&quot;b&quot;:&quot;bb&quot;,&quot;a&quot;:&quot;function() { return true; }&quot;}}" ondblclick="return {&quot;a&quot;:{&quot;b&quot;:&quot;bb&quot;,&quot;a&quot;:&quot;function() { return true; }&quot;}}"></div>
11+
<div data-bem="{&quot;a&quot;:{&quot;a&quot;:{&quot;x&quot;:&quot;xx&quot;,&quot;y&quot;:&quot;yy&quot;},&quot;b&quot;:&quot;bb&quot;,&quot;c&quot;:&quot;cc&quot;},&quot;b&quot;:&quot;bb&quot;}">
12+
</body>
13+
</html>

test/fixtures/_9.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head lang="en">
4+
<meta charset="UTF-8">
5+
<title></title>
6+
</head>
7+
<body>
8+
<label for="sfsdfksdf">label for input</label>
9+
<input id="sfsdfksdf">
10+
<div onclick="return {&quot;a&quot;:{&quot;b&quot;:&quot;bb&quot;,&quot;a&quot;:&quot;function() { return true; }&quot;}}" ondblclick="return {&quot;a&quot;:{&quot;b&quot;:&quot;bb&quot;,&quot;a&quot;:&quot;function() { return true; }&quot;}}"></div>
11+
<div data-bem="{&quot;b&quot;:&quot;bb&quot;,&quot;a&quot;:{&quot;c&quot;:&quot;cc&quot;,&quot;b&quot;:&quot;bb&quot;,&quot;a&quot;:{&quot;y&quot;:&quot;yy&quot;,&quot;x&quot;:&quot;xx&quot;}}}">
12+
</body>
13+
</html>

test/isEqual.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ describe('\'isEqual\'', function () {
6161
});
6262

6363
it('must ignore space characters', function () {
64-
var htmlDiffer = new HtmlDiffer(),
64+
var htmlDiffer = new HtmlDiffer({ ignoreWhitespaces: true }),
6565

6666
files = readFiles('7.html', '_7.html');
6767

@@ -76,4 +76,12 @@ describe('\'isEqual\'', function () {
7676
htmlDiffer.isEqual(files.html1, files.html2).must.be.true();
7777
});
7878

79+
it('must work \'bem\' option', function() {
80+
var htmlDiffer = new HtmlDiffer({ bem: true }),
81+
82+
files = readFiles('9.html', '_9.html');
83+
84+
htmlDiffer.isEqual(files.html1, files.html2).must.be.true();
85+
});
86+
7987
});

0 commit comments

Comments
 (0)