| Index: third_party/pkg/angular/test/core_dom/node_cursor_spec.dart
|
| diff --git a/third_party/pkg/angular/test/core_dom/node_cursor_spec.dart b/third_party/pkg/angular/test/core_dom/node_cursor_spec.dart
|
| index e150804293505b45f2c53d967e16a01ec60add4c..731495e2b7a3931514bdecbff8d02d1adfc012f9 100644
|
| --- a/third_party/pkg/angular/test/core_dom/node_cursor_spec.dart
|
| +++ b/third_party/pkg/angular/test/core_dom/node_cursor_spec.dart
|
| @@ -7,10 +7,10 @@ main() {
|
| var a, b, c, d;
|
|
|
| beforeEach(() {
|
| - a = $('<a>A</a>')[0];
|
| - b = $('<b>B</b>')[0];
|
| - c = $('<i>C</i>')[0];
|
| - d = $('<span></span>')[0];
|
| + a = e('<a>A</a>');
|
| + b = e('<b>B</b>');
|
| + c = e('<i>C</i>');
|
| + d = e('<span></span>');
|
| d.append(a);
|
| d.append(b);
|
| });
|
| @@ -19,10 +19,10 @@ main() {
|
| it('should allow single level traversal', () {
|
| var cursor = new NodeCursor([a, b]);
|
|
|
| - expect(cursor.nodeList(), equals([a]));
|
| - expect(cursor.microNext(), equals(true));
|
| - expect(cursor.nodeList(), equals([b]));
|
| - expect(cursor.microNext(), equals(false));
|
| + expect(cursor.current, equals(a));
|
| + expect(cursor.moveNext(), equals(true));
|
| + expect(cursor.current, equals(b));
|
| + expect(cursor.moveNext(), equals(false));
|
| });
|
|
|
|
|
| @@ -30,38 +30,38 @@ main() {
|
| var cursor = new NodeCursor([d, c]);
|
|
|
| expect(cursor.descend(), equals(true));
|
| - expect(cursor.nodeList(), equals([a]));
|
| - expect(cursor.microNext(), equals(true));
|
| - expect(cursor.nodeList(), equals([b]));
|
| - expect(cursor.microNext(), equals(false));
|
| + expect(cursor.current, equals(a));
|
| + expect(cursor.moveNext(), equals(true));
|
| + expect(cursor.current, equals(b));
|
| + expect(cursor.moveNext(), equals(false));
|
| cursor.ascend();
|
| - expect(cursor.microNext(), equals(true));
|
| - expect(cursor.nodeList(), equals([c]));
|
| - expect(cursor.microNext(), equals(false));
|
| + expect(cursor.moveNext(), equals(true));
|
| + expect(cursor.current, equals(c));
|
| + expect(cursor.moveNext(), equals(false));
|
| });
|
|
|
| it('should descend and ascend two levels', () {
|
| - var l1 = $('<span></span>')[0];
|
| - var l2 = $('<span></span>')[0];
|
| - var e = $('<e>E</e>')[0];
|
| - var f = $('<f>F</f>')[0];
|
| + var l1 = e('<span></span>');
|
| + var l2 = e('<span></span>');
|
| + var g = e('<g>G</g>');
|
| + var f = e('<f>F</f>');
|
| l1.append(l2);
|
| l1.append(f);
|
| - l2.append(e);
|
| + l2.append(g);
|
| var cursor = new NodeCursor([l1, c]);
|
|
|
| expect(cursor.descend(), equals(true));
|
| - expect(cursor.nodeList(), equals([l2]));
|
| + expect(cursor.current, equals(l2));
|
| expect(cursor.descend(), equals(true));
|
| - expect(cursor.nodeList(), equals([e]));
|
| + expect(cursor.current, equals(g));
|
| cursor.ascend();
|
| - expect(cursor.microNext(), equals(true));
|
| - expect(cursor.nodeList(), equals([f]));
|
| - expect(cursor.microNext(), equals(false));
|
| + expect(cursor.moveNext(), equals(true));
|
| + expect(cursor.current, equals(f));
|
| + expect(cursor.moveNext(), equals(false));
|
| cursor.ascend();
|
| - expect(cursor.microNext(), equals(true));
|
| - expect(cursor.nodeList(), equals([c]));
|
| - expect(cursor.microNext(), equals(false));
|
| + expect(cursor.moveNext(), equals(true));
|
| + expect(cursor.current, equals(c));
|
| + expect(cursor.moveNext(), equals(false));
|
| });
|
|
|
|
|
| @@ -82,26 +82,27 @@ main() {
|
|
|
|
|
| it('should create child cursor upon replace of mid level', () {
|
| - var dom = $('<div><span>text</span></div>');
|
| + var dom = es('<div><span>text</span></div>');
|
| var parentCursor = new NodeCursor(dom);
|
| parentCursor.descend(); // <span>
|
|
|
| var childCursor = parentCursor.replaceWithAnchor('child');
|
| expect(STRINGIFY(dom), equals('[<div><!--ANCHOR: child--></div>]'));
|
|
|
| - expect(STRINGIFY(childCursor.elements[0]), equals('<span>text</span>'));
|
| + expect(STRINGIFY(childCursor.elements.first), equals('<span>text</span>'));
|
| });
|
|
|
| it('should preserve the top-level elements', () {
|
| - var dom = $('<span>text</span>MoreText<div>other</div>');
|
| + var dom = es('<span>text</span>MoreText<div>other</div>');
|
| var parentCursor = new NodeCursor(dom);
|
|
|
| var childCursor = parentCursor.replaceWithAnchor('child');
|
| expect(STRINGIFY(dom), equals('[<!--ANCHOR: child-->, MoreText, <div>other</div>]'));
|
|
|
| - expect(STRINGIFY(childCursor.elements[0]), equals('<span>text</span>'));
|
| + expect(STRINGIFY(childCursor.elements.first), equals('<span>text</span>'));
|
| });
|
| });
|
| }
|
|
|
|
|
| +
|
|
|