Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

Commit

Permalink
feat(test): add test code for the readOnly option
Browse files Browse the repository at this point in the history
  • Loading branch information
rotoshine authored and douglasduteil committed Dec 14, 2013
1 parent cffd1e4 commit 5da05ab
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions test/ace.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ describe('uiAce', function () {
expect(compile).not.toThrow();
});


it('should watch the uiAce attribute', function () {
spyOn(scope, '$watch');
$compile('<div ui-ace ng-model="foo">')(scope);
expect(scope.$watch).toHaveBeenCalled();
});

});

describe('instance', function () {
Expand Down Expand Up @@ -84,6 +84,19 @@ describe('uiAce', function () {
});
});

describe('readOnly', function () {
it('should read only option true', function () {
$compile('<div ui-ace="{readOnly:true}">')(scope);
expect(_ace).toBeDefined();
expect(_ace.getReadOnly()).toBeTruthy();
});
it('should read only option false', function () {
$compile('<div ui-ace>')(scope);
expect(_ace).toBeDefined();
expect(_ace.getReadOnly()).toBeFalsy();
});
});

describe('when the model changes', function () {
it('should update the IDE', function () {
$compile('<div ui-ace ng-model="foo">')(scope);
Expand Down Expand Up @@ -151,5 +164,5 @@ describe('uiAce', function () {
});
});


});

0 comments on commit 5da05ab

Please sign in to comment.