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

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

Powered by Google App Engine
This is Rietveld 408576698