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

Unified Diff: third_party/pkg/angular/test/directive/ng_src_boolean_spec.dart

Issue 148453003: Updating Angular version (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
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: third_party/pkg/angular/test/directive/ng_src_boolean_spec.dart
diff --git a/third_party/pkg/angular/test/directive/ng_src_boolean_spec.dart b/third_party/pkg/angular/test/directive/ng_src_boolean_spec.dart
index 7cfa8d703d8a8a9fa4fe8b1f9706bf6f37259012..f09bd8e1685bbdf0d8d1cdc8a1427d86dc276f1c 100644
--- a/third_party/pkg/angular/test/directive/ng_src_boolean_spec.dart
+++ b/third_party/pkg/angular/test/directive/ng_src_boolean_spec.dart
@@ -204,4 +204,46 @@ main() {
expect(_.rootElement.attributes['href']).toEqual('http://server');
}));
});
+
+ describe('ngAttr', () {
+ TestBed _;
+ beforeEach(inject((TestBed tb) => _ = tb));
+
+ it('should interpolate the expression and bind to *', inject(() {
+ _.compile('<div ng-attr-foo="some/{{id}}"></div>');
+ _.rootScope.$digest();
+ expect(_.rootElement.attributes['foo']).toEqual('some/');
+
+ _.rootScope.$apply(() {
+ _.rootScope.id = 1;
+ });
+ expect(_.rootElement.attributes['foo']).toEqual('some/1');
+ }));
+
+
+ it('should bind * and merge with other attrs', inject(() {
+ _.compile('<div ng-attr-bar="{{bar}}" ng-attr-bar2="{{bar2}}" bam="{{bam}}"></a>');
+ _.rootScope.bar = 'foo';
+ _.rootScope.bar2 = 'foo2';
+ _.rootScope.bam = 'boom';
+ _.rootScope.$digest();
+ expect(_.rootElement.attributes['bar']).toEqual('foo');
+ expect(_.rootElement.attributes['bar2']).toEqual('foo2');
+ expect(_.rootElement.attributes['bam']).toEqual('boom');
+ _.rootScope.bar = 'FOO';
+ _.rootScope.bar2 = 'FOO2';
+ _.rootScope.bam = 'BOOM';
+ _.rootScope.$digest();
+ expect(_.rootElement.attributes['bar']).toEqual('FOO');
+ expect(_.rootElement.attributes['bar2']).toEqual('FOO2');
+ expect(_.rootElement.attributes['bam']).toEqual('BOOM');
+ }));
+
+
+ it('should bind * even if no interpolation', inject(() {
+ _.compile('<a ng-attr-quack="vanilla"></a>');
+ _.rootScope.$digest();
+ expect(_.rootElement.attributes['quack']).toEqual('vanilla');
+ }));
+ });
}

Powered by Google App Engine
This is Rietveld 408576698