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

Unified Diff: third_party/pkg/angular/test/core_dom/ng_animate_spec.dart

Issue 257423008: Update all Angular libs (run update_all.sh). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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/core_dom/ng_animate_spec.dart
diff --git a/third_party/pkg/angular/test/core_dom/ng_animate_spec.dart b/third_party/pkg/angular/test/core_dom/ng_animate_spec.dart
new file mode 100644
index 0000000000000000000000000000000000000000..3d85fd7426f5bd687c1d3ffb9dde5cf85d855046
--- /dev/null
+++ b/third_party/pkg/angular/test/core_dom/ng_animate_spec.dart
@@ -0,0 +1,89 @@
+library no_animate_spec;
+
+import '../_specs.dart';
+
+main() {
+ describe('NgAniamte', () {
+ TestBed _;
+ beforeEach((TestBed tb) => _ = tb);
+
+ it('should exist',
+ (Animate aniamte) {
+ expect(aniamte).toBeDefined();
+ });
+
+ it('should add a css classes to nodes.', () {
+ var animate = new Animate();
+ _.compile('<div></div>');
+ expect(_.rootElement).not.toHaveClass('foo');
+ animate.addClass(_.rootElement, 'foo');
+ expect(_.rootElement).toHaveClass('foo');
+ });
+
+ it('should remove css classes from nodes.', () {
+ var animate = new Animate();
+ _.compile('<div class="foo"></div>');
+ expect(_.rootElement).toHaveClass('foo');
+ animate.removeClass(_.rootElement, 'foo');
+ expect(_.rootElement).not.toHaveClass('foo');
+ });
+
+ it('should insert elements', () {
+ var animate = new Animate();
+ _.compile('<div></div>');
+ expect(_.rootElement.children.length).toBe(0);
+ animate.insert([new Element.div()], _.rootElement);
+ expect(_.rootElement.children.length).toBe(1);
+ });
+
+ it('should remove nodes and elements', () {
+ var animate = new Animate();
+ _.compile('<div><p>Hello World</p><!--comment--></div>');
+ expect(_.rootElement.childNodes.length).toBe(2);
+ animate.remove(_.rootElement.childNodes);
+ expect(_.rootElement.childNodes.length).toBe(0);
+ });
+
+ it('should move nodes and elements', () {
+ var animate = new Animate();
+ _.compile('<div></div>');
+ List<Node> a = es('<span>A</span>a');
+ List<Node> b = es('<span>B</span>b');
+ a.forEach((n) => _.rootElement.append(n));
+ b.forEach((n) => _.rootElement.append(n));
+
+ expect(_.rootElement.text).toEqual("AaBb");
+
+ animate.move(b, _.rootElement, insertBefore: a.first);
+ expect(_.rootElement.text).toEqual("BbAa");
+
+ animate.move(a, _.rootElement, insertBefore: b.first);
+ expect(_.rootElement.text).toEqual("AaBb");
+
+ animate.move(a, _.rootElement);
+ expect(_.rootElement.text).toEqual("BbAa");
+ });
+ });
+
+ describe('NoOpAnimation', () {
+ it('should not do anything async unless the future is asked for', () {
+ var completer = new NoOpAnimation();
+ expect(completer).toBeDefined();
+ });
+
+ it('should create a future once onCompleted is accessed', () {
+ expect(() => new NoOpAnimation().onCompleted).toThrow();
+ });
+
+ it('should return a [COMPLETED_IGNORED] result when completed.', async(() {
+ bool success = false;
+ new NoOpAnimation().onCompleted.then((result) {
+ if (result == AnimationResult.COMPLETED_IGNORED) {
+ success = true;
+ }
+ });
+ microLeap();
+ expect(success).toBe(true);
+ }));
+ });
+}
« no previous file with comments | « third_party/pkg/angular/test/core_dom/mustache_spec.dart ('k') | third_party/pkg/angular/test/core_dom/ng_element_spec.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698