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

Unified Diff: third_party/pkg/angular/test/_specs_spec.dart

Issue 124053002: Adding Angular and dependent packages for testing (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 12 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: third_party/pkg/angular/test/_specs_spec.dart
diff --git a/third_party/pkg/angular/test/_specs_spec.dart b/third_party/pkg/angular/test/_specs_spec.dart
new file mode 100644
index 0000000000000000000000000000000000000000..bb19bc1f9c46edc59deb2b28bf57093436324d51
--- /dev/null
+++ b/third_party/pkg/angular/test/_specs_spec.dart
@@ -0,0 +1,40 @@
+library _specs_spec;
+
+import '_specs.dart';
+
+main() {
+ describe('renderedText', () {
+ it('should work on regular DOM nodes', () {
+ expect(renderedText($('<span>A<span>C</span></span><span>B</span>'))).toEqual('ACB');
+ });
+
+ it('should work with shadow DOM', () {
+ var elt = $('<div>DOM content</div>');
+ var shadow = elt[0].createShadowRoot();
+ shadow.setInnerHtml(
+ '<div>Shadow content</div><content>SHADOW-CONTENT</content>',
+ treeSanitizer: new NullTreeSanitizer());
+ expect(renderedText(elt)).toEqual('Shadow contentDOM content');
+ });
+
+ it('should ignore comments', () {
+ expect(renderedText($('<!--e--><span>A<span>C</span></span><span>B</span>'))).toEqual('ACB');
+ });
+ });
+
+
+ describe('jquery', () {
+ describe('html', () {
+ it('get', (){
+ var div = $('<div>');
+ expect(div.html()).toEqual('');
+ });
+
+ it('set', (){
+ var div = $('<div>');
+ expect(div.html('text')).toBe(div);
+ expect(div.html()).toEqual('text');
+ });
+ });
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698