aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-10-12 21:18:52 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2017-10-12 21:18:52 +0900
commit4646e8b18d05e7b97db1857981baef5a23903db6 (patch)
treeeca17efeb34904a5b788faa679d4d926b69d4b86 /test
parent10beccfab2361e97a25628e017662dee70c079a9 (diff)
fix follow for contenteditable
Diffstat (limited to 'test')
-rw-r--r--test/content/components/follow.html5
-rw-r--r--test/content/components/follow.test.js7
2 files changed, 9 insertions, 3 deletions
diff --git a/test/content/components/follow.html b/test/content/components/follow.html
index 6bd8f87..eb0decd 100644
--- a/test/content/components/follow.html
+++ b/test/content/components/follow.html
@@ -1,9 +1,12 @@
<!DOCTYPE html>
<html>
<body>
- <a href='#' >link</a>
+ <a id='visible_a' href='#' >link</a>
<a href='#' style='display:none'>invisible 1</a>
<a href='#' style='visibility:hidden'>invisible 2</a>
<i>not link<i>
+ <div id='editable_div_1' contenteditable>link</div>
+ <div id='editable_div_2' contenteditable='true'>link</div>
+ <div id='x' contenteditable='false'>link</div>
</body>
</html>
diff --git a/test/content/components/follow.test.js b/test/content/components/follow.test.js
index 9c00c79..5c3e1d5 100644
--- a/test/content/components/follow.test.js
+++ b/test/content/components/follow.test.js
@@ -8,8 +8,11 @@ describe('FollowComponent', () => {
});
it('returns visible links', () => {
- let links = FollowComponent.getTargetElements(window.document);
- expect(links).to.have.lengthOf(1);
+ let targets = FollowComponent.getTargetElements(window.document);
+ expect(targets).to.have.lengthOf(3);
+
+ let ids = Array.prototype.map.call(targets, (e) => e.id);
+ expect(ids).to.include.members(['visible_a', 'editable_div_1', 'editable_div_2']);
});
});
});