Skip to content

Commit 2939c90

Browse files
Sebmasterdomenic
authored andcommitted
Test if steam page with < breaks parser
Fixes jsdom#800.
1 parent aae6fd6 commit 2939c90

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

test/jsdom/files/steam.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2+
<html>
3+
<head>
4+
<title>Steam Community :: Steam Badges :: Wooden Sen'SeY</title>
5+
</head>
6+
7+
<body class="flat_page">
8+
9+
<div class="pagecontent ">
10+
11+
<div class="maincontent">
12+
13+
14+
<div class="badge_row depressed badge_gamecard_page">
15+
<div class="badge_row_inner">
16+
<div class="badge_detail_tasks">
17+
<div class="badge_card_set_card unowned">
18+
<div class="badge_card_set_text">
19+
<3luv<3<div style="clear: right"></div>
20+
</div>
21+
</div>
22+
<div class="badge_card_set_card unowned">
23+
<div class="badge_card_set_text">
24+
Old Dude > Sen'SeY <div style="clear: right"></div>
25+
</div>
26+
</div>
27+
</div>
28+
</div>
29+
</div>
30+
</div>
31+
</div>
32+
33+
</body>
34+
</html>

test/jsdom/parsing.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use strict";
22

3+
var path = require("path");
34
var jsdom = require("../..").jsdom;
45

56
// These tests are mostly random regression tests, not systematic parsing tests. They are compiled from the bug tracker.
@@ -271,3 +272,16 @@ exports["querySelector should not throw when applied to Document fragments (GH-5
271272

272273
t.done();
273274
};
275+
276+
exports["< should not break the parser (GH-800)"] = function (t) {
277+
t.expect(2);
278+
279+
jsdom.env(
280+
path.resolve(__dirname, "files", "steam.html"),
281+
function (errors, window) {
282+
t.ifError(errors);
283+
t.notEqual(window.document.querySelector(".badge_card_set_text"), null);
284+
285+
t.done();
286+
});
287+
};

0 commit comments

Comments
 (0)