Skip to content

Commit 14b3116

Browse files
author
Christopher Hiller
committed
adding whitespace for readability
1 parent 79c84f1 commit 14b3116

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

modules/directives/codemirror/test/codemirrorSpec.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,44 +12,52 @@ describe('uiCodemirror', function () {
1212
scope = _$rootScope_.$new();
1313
$compile = _$compile_;
1414
}));
15+
1516
afterEach(function() {
1617
angular.module('ui.config').value('ui.config', {}); // cleanup
1718
});
19+
1820
describe('compiling this directive', function () {
1921
it('should throw an error if used against a non-textarea', function () {
2022
function compile() {
2123
$compile('<div ui-codemirror ng-model="foo"></div>')(scope);
2224
}
2325
expect(compile).toThrow();
2426
});
27+
2528
it('should not throw an error when used against a textarea', function () {
2629
function compile() {
2730
$compile('<textarea ui-codemirror ng-model="foo"></textarea>')(scope);
2831
}
2932
expect(compile).not.toThrow();
3033
});
34+
3135
it('should throw an error when no ngModel attribute defined', function () {
3236
function compile() {
3337
$compile('<textarea ui-codemirror></textarea>')(scope);
3438
}
3539
expect(compile).toThrow();
3640
});
41+
3742
it('should watch the uiCodemirror attribute', function () {
3843
spyOn(scope, '$watch');
3944
$compile('<textarea ui-codemirror ng-model="foo"></textarea>')(scope);
4045
expect(scope.$watch).toHaveBeenCalled();
4146
});
47+
4248
it('should include the passed options', function () {
4349
spyOn(CodeMirror, 'fromTextArea');
4450
$compile('<textarea ui-codemirror="{foo: \'bar\'}" ng-model="foo"></textarea>')(scope);
4551
expect(CodeMirror.fromTextArea.mostRecentCall.args[1].foo).toEqual('bar');
4652
});
53+
4754
it('should include the default options', function () {
4855
spyOn(CodeMirror, 'fromTextArea');
4956
$compile('<textarea ui-codemirror ng-model="foo"></textarea>')(scope);
5057
expect(CodeMirror.fromTextArea.mostRecentCall.args[1].bar).toEqual('baz');
5158
});
5259
});
60+
5361
describe('when the model changes', function () {
5462
it('should update the IDE', function () {
5563
var element = $compile('<textarea ui-codemirror ng-model="foo"></textarea>')(scope);
@@ -58,6 +66,7 @@ describe('uiCodemirror', function () {
5866
expect(element.siblings().text().trim()).toBe(scope.foo);
5967
});
6068
});
69+
6170
describe('when the IDE changes', function () {
6271
it('should update the model', function () {
6372
var codemirror,
@@ -74,6 +83,7 @@ describe('uiCodemirror', function () {
7483
expect(scope.foo).toBe(value);
7584
});
7685
});
86+
7787
describe('when the model is undefined/null', function () {
7888
it('should update the IDE with an empty string', function () {
7989
var element = $compile('<textarea ui-codemirror ng-model="foo"></textarea>')(scope);
@@ -86,6 +96,7 @@ describe('uiCodemirror', function () {
8696
expect(element.siblings().text().trim()).toBe('');
8797
});
8898
});
99+
89100
describe('when the model is an object or an array', function () {
90101
it('should throw an error', function () {
91102
function compileWithObject() {

0 commit comments

Comments
 (0)