@@ -71,17 +71,17 @@ describe('uiCodemirror', function () {
71
71
it ( 'should call the CodeMirror constructor with a function' , function ( ) {
72
72
$compile ( '<div ui-codemirror></div>' ) ( scope ) ;
73
73
74
- expect ( CodeMirror . callCount ) . toEqual ( 1 ) ;
75
- expect ( CodeMirror ) . toHaveBeenCalledWith ( jasmine . any ( Function ) , jasmine . any ( Object ) ) ;
74
+ expect ( window . CodeMirror . callCount ) . toEqual ( 1 ) ;
75
+ expect ( window . CodeMirror ) . toHaveBeenCalledWith ( jasmine . any ( Function ) , jasmine . any ( Object ) ) ;
76
76
77
77
expect ( codemirror ) . toBeDefined ( ) ;
78
78
} ) ;
79
79
80
80
it ( 'should work as an element' , function ( ) {
81
81
$compile ( '<ui-codemirror></ui-codemirror>' ) ( scope ) ;
82
82
83
- expect ( CodeMirror . callCount ) . toEqual ( 1 ) ;
84
- expect ( CodeMirror ) . toHaveBeenCalledWith ( jasmine . any ( Function ) , jasmine . any ( Object ) ) ;
83
+ expect ( window . CodeMirror . callCount ) . toEqual ( 1 ) ;
84
+ expect ( window . CodeMirror ) . toHaveBeenCalledWith ( jasmine . any ( Function ) , jasmine . any ( Object ) ) ;
85
85
86
86
expect ( codemirror ) . toBeDefined ( ) ;
87
87
} ) ;
@@ -91,10 +91,10 @@ describe('uiCodemirror', function () {
91
91
var element = $compile ( '<div><div ui-codemirror></div></div>' ) ( scope ) . children ( ) ;
92
92
93
93
expect ( element ) . toBeDefined ( ) ;
94
- expect ( element . prop ( " tagName" ) ) . toBe ( " DIV" ) ;
95
- expect ( element . prop ( " classList" ) . length ) . toEqual ( 2 ) ;
96
- expect ( element . prop ( " classList" ) [ 0 ] ) . toEqual ( " CodeMirror" ) ;
97
- expect ( element . prop ( " classList" ) [ 1 ] ) . toEqual ( " cm-s-default" ) ;
94
+ expect ( element . prop ( ' tagName' ) ) . toBe ( ' DIV' ) ;
95
+ expect ( element . prop ( ' classList' ) . length ) . toEqual ( 2 ) ;
96
+ expect ( element . prop ( ' classList' ) [ 0 ] ) . toEqual ( ' CodeMirror' ) ;
97
+ expect ( element . prop ( ' classList' ) [ 1 ] ) . toEqual ( ' cm-s-default' ) ;
98
98
} ) ;
99
99
100
100
@@ -114,13 +114,13 @@ describe('uiCodemirror', function () {
114
114
115
115
expect ( codemirror . setOption ) . toHaveBeenCalled ( ) ;
116
116
expect ( codemirror . setOption . calls . length ) . toEqual ( 1 ) ;
117
- expect ( codemirror . setOption ) . toHaveBeenCalledWith ( " oof" , " baar" ) ;
117
+ expect ( codemirror . setOption ) . toHaveBeenCalledWith ( ' oof' , ' baar' ) ;
118
118
119
119
$compile ( '<ui-codemirror ui-codemirror-opts="{oof: \'baar\'}"></ui-codemirror>' ) ( scope ) ;
120
120
121
121
expect ( codemirror . setOption ) . toHaveBeenCalled ( ) ;
122
122
expect ( codemirror . setOption . calls . length ) . toEqual ( 1 ) ;
123
- expect ( codemirror . setOption ) . toHaveBeenCalledWith ( " oof" , " baar" ) ;
123
+ expect ( codemirror . setOption ) . toHaveBeenCalledWith ( ' oof' , ' baar' ) ;
124
124
} ) ;
125
125
126
126
it ( 'should include the default options' , function ( ) {
@@ -130,7 +130,7 @@ describe('uiCodemirror', function () {
130
130
131
131
expect ( codemirror . setOption ) . toHaveBeenCalled ( ) ;
132
132
expect ( codemirror . setOption . calls . length ) . toEqual ( 1 ) ;
133
- expect ( codemirror . setOption ) . toHaveBeenCalledWith ( " bar" , " baz" ) ;
133
+ expect ( codemirror . setOption ) . toHaveBeenCalledWith ( ' bar' , ' baz' ) ;
134
134
} ) ;
135
135
136
136
it ( 'should extent the default options' , function ( ) {
@@ -140,8 +140,8 @@ describe('uiCodemirror', function () {
140
140
141
141
expect ( codemirror . setOption ) . toHaveBeenCalled ( ) ;
142
142
expect ( codemirror . setOption . calls . length ) . toEqual ( 2 ) ;
143
- expect ( codemirror . setOption ) . toHaveBeenCalledWith ( " oof" , " baar" ) ;
144
- expect ( codemirror . setOption ) . toHaveBeenCalledWith ( " bar" , " baz" ) ;
143
+ expect ( codemirror . setOption ) . toHaveBeenCalledWith ( ' oof' , ' baar' ) ;
144
+ expect ( codemirror . setOption ) . toHaveBeenCalledWith ( ' bar' , ' baz' ) ;
145
145
} ) ;
146
146
147
147
it ( 'should impact codemirror' , function ( ) {
@@ -150,10 +150,10 @@ describe('uiCodemirror', function () {
150
150
$compile ( '<div ui-codemirror="{theme: \'baar\'}"></div>' ) ( scope ) ;
151
151
expect ( codemirror . setOption ) . toHaveBeenCalled ( ) ;
152
152
expect ( codemirror . setOption . calls . length ) . toEqual ( 1 ) ;
153
- expect ( codemirror . setOption ) . toHaveBeenCalledWith ( " theme" , " baar" ) ;
153
+ expect ( codemirror . setOption ) . toHaveBeenCalledWith ( ' theme' , ' baar' ) ;
154
154
155
155
156
- expect ( codemirror . getOption ( " theme" ) ) . toEqual ( " baar" ) ;
156
+ expect ( codemirror . getOption ( ' theme' ) ) . toEqual ( ' baar' ) ;
157
157
} ) ;
158
158
} ) ;
159
159
@@ -193,13 +193,13 @@ describe('uiCodemirror', function () {
193
193
var element = $compile ( '<div><div ui-codemirror ng-model="foo"></div></div>' ) ( scope ) . children ( ) ;
194
194
195
195
expect ( element ) . toBeDefined ( ) ;
196
- expect ( element . attr ( " class" ) ) . toEqual ( 'CodeMirror cm-s-default ng-pristine ng-valid' ) ;
196
+ expect ( element . attr ( ' class' ) ) . toEqual ( 'CodeMirror cm-s-default ng-pristine ng-valid' ) ;
197
197
198
198
var value = 'baz' ;
199
199
codemirror . setValue ( value ) ;
200
200
expect ( scope . foo ) . toBe ( value ) ;
201
201
202
- expect ( element . attr ( " class" ) ) . toEqual ( 'CodeMirror cm-s-default ng-valid ng-dirty' ) ;
202
+ expect ( element . attr ( ' class' ) ) . toEqual ( 'CodeMirror cm-s-default ng-valid ng-dirty' ) ;
203
203
204
204
} ) ;
205
205
@@ -208,18 +208,18 @@ describe('uiCodemirror', function () {
208
208
var element = $compile ( '<div><div ui-codemirror ng-model="foo"></div></div>' ) ( scope ) . children ( ) ;
209
209
210
210
expect ( element ) . toBeDefined ( ) ;
211
- expect ( element . attr ( " class" ) ) . toEqual ( 'CodeMirror cm-s-default ng-pristine ng-valid' ) ;
211
+ expect ( element . attr ( ' class' ) ) . toEqual ( 'CodeMirror cm-s-default ng-pristine ng-valid' ) ;
212
212
213
213
scope . $apply ( 'foo = "bar"' ) ;
214
214
expect ( codemirror . getValue ( ) ) . toBe ( scope . foo ) ;
215
215
216
- expect ( element . attr ( " class" ) ) . toEqual ( 'CodeMirror cm-s-default ng-pristine ng-valid' ) ;
216
+ expect ( element . attr ( ' class' ) ) . toEqual ( 'CodeMirror cm-s-default ng-pristine ng-valid' ) ;
217
217
} ) ;
218
218
219
219
220
220
it ( 'when the IDE changes should use ngChange' , function ( ) {
221
221
scope . change = angular . noop ;
222
- spyOn ( scope , " change" ) . andCallFake ( function ( ) { expect ( scope . foo ) . toBe ( 'baz' ) ; } ) ;
222
+ spyOn ( scope , ' change' ) . andCallFake ( function ( ) { expect ( scope . foo ) . toBe ( 'baz' ) ; } ) ;
223
223
224
224
$compile ( '<div ui-codemirror ng-model="foo" ng-change="change()"></div>' ) ( scope ) ;
225
225
@@ -239,7 +239,7 @@ describe('uiCodemirror', function () {
239
239
240
240
it ( 'should runs the onLoad callback' , function ( ) {
241
241
scope . codemirrorLoaded = angular . noop ;
242
- spyOn ( scope , " codemirrorLoaded" ) ;
242
+ spyOn ( scope , ' codemirrorLoaded' ) ;
243
243
244
244
$compile ( '<div ui-codemirror="{onLoad: codemirrorLoaded}"></div>' ) ( scope ) ;
245
245
0 commit comments