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

Side by Side Diff: third_party/pkg/angular/test/directive/ng_show_hide_spec.dart

Issue 180843004: Revert revision 33053 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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_show_hide_spec; 1 library ng_show_hide_spec;
2 2
3 import '../_specs.dart'; 3 import '../_specs.dart';
4 4
5 5
6 main() { 6 main() {
7 describe('NgHide', () { 7 describe('NgHide', () {
8 TestBed _; 8 TestBed _;
9 beforeEach(inject((TestBed tb) => _ = tb)); 9 beforeEach(inject((TestBed tb) => _ = tb));
10 10
11 it('should add/remove ng-hide class', () { 11 it('should add/remove ng-hide class', () {
12 _.compile('<div ng-hide="isHidden"></div>'); 12 _.compile('<div ng-hide="isHidden"></div>');
13 13
14 expect(_.rootElement).not.toHaveClass('ng-hide'); 14 expect(_.rootElement).not.toHaveClass('ng-hide');
15 15
16 _.rootScope.apply(() { 16 _.rootScope.$apply(() {
17 _.rootScope.context['isHidden'] = true; 17 _.rootScope['isHidden'] = true;
18 }); 18 });
19 expect(_.rootElement).toHaveClass('ng-hide'); 19 expect(_.rootElement).toHaveClass('ng-hide');
20 20
21 _.rootScope.apply(() { 21 _.rootScope.$apply(() {
22 _.rootScope.context['isHidden'] = false; 22 _.rootScope['isHidden'] = false;
23 }); 23 });
24 expect(_.rootElement).not.toHaveClass('ng-hide'); 24 expect(_.rootElement).not.toHaveClass('ng-hide');
25 }); 25 });
26 }); 26 });
27
28 describe('NgShow', () {
29 TestBed _;
30 beforeEach(inject((TestBed tb) => _ = tb));
31
32 it('should add/remove ng-hide class', () {
33 _.compile('<div ng-show="isShown"></div>');
34
35 expect(_.rootElement).not.toHaveClass('ng-hide');
36
37 _.rootScope.apply(() {
38 _.rootScope.context['isShown'] = true;
39 });
40 expect(_.rootElement).not.toHaveClass('ng-hide');
41
42 _.rootScope.apply(() {
43 _.rootScope.context['isShown'] = false;
44 });
45 expect(_.rootElement).toHaveClass('ng-hide');
46 });
47 });
48 } 27 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698