aboutsummaryrefslogtreecommitdiffstats
path: root/test/jqLiteSpec.js
diff options
context:
space:
mode:
authorMatias Niemelä2014-02-14 00:25:10 -0500
committerIgor Minar2014-02-14 15:49:08 -0800
commitb7e4e92014a5fe7a2d8c896703498090d88793ce (patch)
tree2ad08d537bf349aa6d59cf72e2b85bdcabffb159 /test/jqLiteSpec.js
parent31c450bcee53d0a3827b7e0a611e9013b2496506 (diff)
downloadangular.js-b7e4e92014a5fe7a2d8c896703498090d88793ce.tar.bz2
chore(jqLite): expose the _data lookup function to angular.element
Diffstat (limited to 'test/jqLiteSpec.js')
-rw-r--r--test/jqLiteSpec.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js
index a98e94b9..82db95b6 100644
--- a/test/jqLiteSpec.js
+++ b/test/jqLiteSpec.js
@@ -97,6 +97,23 @@ describe('jqLite', function() {
});
});
+ describe('_data', function() {
+ it('should provide access to the data present on the element', function() {
+ var element = jqLite('<i>foo</i>');
+ var data = ['value'];
+ element.data('val', data);
+ expect(angular.element._data(element[0]).data.val).toBe(data);
+ dealoc(element);
+ });
+
+ it('should provide access to the events present on the element', function() {
+ var element = jqLite('<i>foo</i>');
+ expect(angular.element._data(element[0]).events).toBeUndefined();
+
+ element.on('click', function() { });
+ expect(angular.element._data(element[0]).events.click).toBeDefined();
+ });
+ });
describe('inheritedData', function() {