Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(390)

Unified Diff: tools/vulcanize/node_modules/vulcanize/node_modules/cheerio/test/utilities.js

Issue 125733002: Add vulcanize to tools. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/vulcanize/node_modules/vulcanize/node_modules/cheerio/test/utilities.js
diff --git a/tools/vulcanize/node_modules/vulcanize/node_modules/cheerio/test/utilities.js b/tools/vulcanize/node_modules/vulcanize/node_modules/cheerio/test/utilities.js
new file mode 100644
index 0000000000000000000000000000000000000000..841716652c62c74579974cc7f753ccaec90cc107
--- /dev/null
+++ b/tools/vulcanize/node_modules/vulcanize/node_modules/cheerio/test/utilities.js
@@ -0,0 +1,33 @@
+var expect = require('expect.js'),
+ $ = require('../'),
+ food = require('./fixtures').food;
+
+describe('utility methods', function() {
+
+ describe('.contains', function() {
+
+ it('(container, contained) : should correctly detect the provided element', function() {
+ var $food = $(food);
+ var $fruits = $food.find('#fruits');
+ var $apple = $fruits.find('.apple');
+
+ expect($.contains($food[0], $fruits[0])).to.equal(true);
+ expect($.contains($food[0], $apple[0])).to.equal(true);
+ });
+
+ it('(container, other) : should not detect elements that are not contained', function() {
+ var $food = $(food);
+ var $fruits = $food.find('#fruits');
+ var $vegetables = $food.find('#vegetables');
+ var $apple = $fruits.find('.apple');
+
+ expect($.contains($vegetables[0], $apple[0])).to.equal(false);
+ expect($.contains($fruits[0], $vegetables[0])).to.equal(false);
+ expect($.contains($vegetables[0], $fruits[0])).to.equal(false);
+ expect($.contains($fruits[0], $fruits[0])).to.equal(false);
+ expect($.contains($vegetables[0], $vegetables[0])).to.equal(false);
+ });
+
+ });
+
+});

Powered by Google App Engine
This is Rietveld 408576698