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

Side by Side Diff: third_party/pkg/angular/test/directive/ng_bind_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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 library ng_bind_spec; 1 library ng_bind_spec;
2 2
3 import '../_specs.dart'; 3 import '../_specs.dart';
4 4
5 main() { 5 main() {
6 describe('BindDirective', () { 6 describe('BindDirective', () {
7 TestBed _; 7 TestBed _;
8 8
9 beforeEach(inject((TestBed tb) => _ = tb)); 9 beforeEach((TestBed tb) => _ = tb);
10 10
11 it('should set.text', inject((Scope scope, Injector injector, Compiler compi ler, DirectiveMap directives) { 11 it('should set.text', (Scope scope, Injector injector, Compiler compiler, Di rectiveMap directives) {
12 var element = $('<div ng-bind="a"></div>'); 12 var element = e('<div ng-bind="a"></div>');
13 compiler(element, directives)(injector, element); 13 compiler([element], directives)(injector, [element]);
14 scope.context['a'] = "abc123"; 14 scope.context['a'] = "abc123";
15 scope.apply(); 15 scope.apply();
16 expect(element.text()).toEqual('abc123'); 16 expect(element.text).toEqual('abc123');
17 })); 17 });
18 18
19 19
20 it('should bind to non string values', inject((Scope scope) { 20 it('should bind to non string values', (Scope scope) {
21 var element = _.compile('<div ng-bind="value"></div>'); 21 var element = _.compile('<div ng-bind="value"></div>');
22 22
23 scope.apply(() { 23 scope.apply(() {
24 scope.context['value'] = null; 24 scope.context['value'] = null;
25 }); 25 });
26 expect(element.text).toEqual(''); 26 expect(element.text).toEqual('');
27 27
28 scope.apply(() { 28 scope.apply(() {
29 scope.context['value'] = true; 29 scope.context['value'] = true;
30 }); 30 });
31 expect(element.text).toEqual('true'); 31 expect(element.text).toEqual('true');
32 32
33 scope.apply(() { 33 scope.apply(() {
34 scope.context['value'] = 1; 34 scope.context['value'] = 1;
35 }); 35 });
36 expect(element.text).toEqual('1'); 36 expect(element.text).toEqual('1');
37 })); 37 });
38 }); 38 });
39 } 39 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698