From fd822bdaf9d04e522aaa5400b673f333190abe98 Mon Sep 17 00:00:00 2001
From: Misko Hevery
Date: Fri, 7 Oct 2011 11:27:49 -0700
Subject: chore(formating): clean code to be function() {
---
test/widget/inputSpec.js | 84 ++++++++++++++++++++++++------------------------
1 file changed, 42 insertions(+), 42 deletions(-)
(limited to 'test/widget/inputSpec.js')
diff --git a/test/widget/inputSpec.js b/test/widget/inputSpec.js
index 31f8c59c..d8d7f928 100644
--- a/test/widget/inputSpec.js
+++ b/test/widget/inputSpec.js
@@ -1,6 +1,6 @@
'use strict';
-describe('widget: input', function(){
+describe('widget: input', function() {
var compile = null, element = null, scope = null, defer = null;
var doc = null;
@@ -21,13 +21,13 @@ describe('widget: input', function(){
};
});
- afterEach(function(){
+ afterEach(function() {
dealoc(element);
dealoc(doc);
});
- describe('text', function(){
+ describe('text', function() {
var scope = null,
form = null,
formElement = null,
@@ -46,7 +46,7 @@ describe('widget: input', function(){
};
- it('should bind update scope from model', function(){
+ it('should bind update scope from model', function() {
createInput();
expect(scope.form.name.$required).toBe(false);
scope.name = 'misko';
@@ -55,7 +55,7 @@ describe('widget: input', function(){
});
- it('should require', function(){
+ it('should require', function() {
createInput({required:''});
expect(scope.form.name.$required).toBe(true);
scope.$digest();
@@ -66,10 +66,10 @@ describe('widget: input', function(){
});
- it('should call $destroy on element remove', function(){
+ it('should call $destroy on element remove', function() {
createInput();
var log = '';
- form.$on('$destroy', function(){
+ form.$on('$destroy', function() {
log += 'destroy;';
});
inputElement.remove();
@@ -77,10 +77,10 @@ describe('widget: input', function(){
});
- it('should update the model and trim input', function(){
+ it('should update the model and trim input', function() {
createInput();
var log = '';
- scope.change = function(){
+ scope.change = function() {
log += 'change();';
};
inputElement.val(' a ');
@@ -91,14 +91,14 @@ describe('widget: input', function(){
});
- it('should change non-html5 types to text', function(){
+ it('should change non-html5 types to text', function() {
doc = angular.element('
');
scope = angular.compile(doc)();
expect(doc.find('input').attr('type')).toEqual('text');
});
- it('should not change html5 types to text', function(){
+ it('should not change html5 types to text', function() {
doc = angular.element('');
scope = angular.compile(doc)();
expect(doc.find('input')[0].getAttribute('type')).toEqual('number');
@@ -106,10 +106,10 @@ describe('widget: input', function(){
});
- describe("input", function(){
+ describe("input", function() {
- describe("text", function(){
- it('should input-text auto init and handle keydown/change events', function(){
+ describe("text", function() {
+ it('should input-text auto init and handle keydown/change events', function() {
compile('');
scope.name = 'Adam';
@@ -130,7 +130,7 @@ describe('widget: input', function(){
});
- it('should not trigger eval if value does not change', function(){
+ it('should not trigger eval if value does not change', function() {
compile('');
scope.name = 'Misko';
scope.$digest();
@@ -143,7 +143,7 @@ describe('widget: input', function(){
});
- it('should allow complex reference binding', function(){
+ it('should allow complex reference binding', function() {
compile('
'+
''+
'
');
@@ -153,8 +153,8 @@ describe('widget: input', function(){
});
- describe("ng:format", function(){
- it("should format text", function(){
+ describe("ng:format", function() {
+ it("should format text", function() {
compile('');
scope.list = ['x', 'y', 'z'];
@@ -168,14 +168,14 @@ describe('widget: input', function(){
});
- it("should render as blank if null", function(){
+ it("should render as blank if null", function() {
compile('');
expect(scope.age).toBeNull();
expect(scope.$element[0].value).toEqual('');
});
- it("should show incorrect text while number does not parse", function(){
+ it("should show incorrect text while number does not parse", function() {
compile('');
scope.age = 123;
scope.$digest();
@@ -195,7 +195,7 @@ describe('widget: input', function(){
});
- it("should not clobber text if model changes due to itself", function(){
+ it("should not clobber text if model changes due to itself", function() {
// When the user types 'a,b' the 'a,' stage parses to ['a'] but if the
// $parseModel function runs it will change to 'a', in essence preventing
// the user from ever typying ','.
@@ -227,7 +227,7 @@ describe('widget: input', function(){
});
- it("should come up blank when no value specified", function(){
+ it("should come up blank when no value specified", function() {
compile('');
scope.$digest();
expect(scope.$element.val()).toEqual('');
@@ -236,15 +236,15 @@ describe('widget: input', function(){
});
- describe("checkbox", function(){
- it("should format booleans", function(){
+ describe("checkbox", function() {
+ it("should format booleans", function() {
compile('');
expect(scope.name).toBe(false);
expect(scope.$element[0].checked).toBe(false);
});
- it('should support type="checkbox" with non-standard capitalization', function(){
+ it('should support type="checkbox" with non-standard capitalization', function() {
compile('');
browserTrigger(element);
@@ -255,7 +255,7 @@ describe('widget: input', function(){
});
- it('should allow custom enumeration', function(){
+ it('should allow custom enumeration', function() {
compile('');
scope.name='ano';
@@ -280,7 +280,7 @@ describe('widget: input', function(){
});
- it("should process required", function(){
+ it("should process required", function() {
compile('', jqLite(document.body));
expect(scope.$service('$formFactory').rootForm.p.$required).toBe(true);
expect(element.hasClass('ng-invalid')).toBeTruthy();
@@ -320,7 +320,7 @@ describe('widget: input', function(){
});
- describe('textarea', function(){
+ describe('textarea', function() {
it("should process textarea", function() {
compile('');
@@ -341,8 +341,8 @@ describe('widget: input', function(){
});
- describe('radio', function(){
- it('should support type="radio"', function(){
+ describe('radio', function() {
+ it('should support type="radio"', function() {
compile('
' +
'' +
'' +
@@ -366,7 +366,7 @@ describe('widget: input', function(){
});
- it('should honor model over html checked keyword after', function(){
+ it('should honor model over html checked keyword after', function() {
compile('
' +
'' +
'' +
@@ -380,7 +380,7 @@ describe('widget: input', function(){
});
- it('should honor model over html checked keyword before', function(){
+ it('should honor model over html checked keyword before', function() {
compile('
' +
'' +
'' +
@@ -395,22 +395,22 @@ describe('widget: input', function(){
});
- it('should ignore text widget which have no name', function(){
+ it('should ignore text widget which have no name', function() {
compile('');
expect(scope.$element.attr('ng-exception')).toBeFalsy();
expect(scope.$element.hasClass('ng-exception')).toBeFalsy();
});
- it('should ignore checkbox widget which have no name', function(){
+ it('should ignore checkbox widget which have no name', function() {
compile('');
expect(scope.$element.attr('ng-exception')).toBeFalsy();
expect(scope.$element.hasClass('ng-exception')).toBeFalsy();
});
- it('should report error on assignment error', function(){
- expect(function(){
+ it('should report error on assignment error', function() {
+ expect(function() {
compile('');
}).toThrow("Syntax Error: Token '''' is an unexpected token at column 7 of the expression [throw ''] starting at [''].");
$logMock.error.logs.shift();
@@ -418,8 +418,8 @@ describe('widget: input', function(){
});
- describe('scope declaration', function(){
- it('should read the declaration from scope', function(){
+ describe('scope declaration', function() {
+ it('should read the declaration from scope', function() {
var input, $formFactory;
element = angular.element('');
scope = angular.scope();
@@ -451,18 +451,18 @@ describe('widget: input', function(){
});
- describe('text subtypes', function(){
+ describe('text subtypes', function() {
function itShouldVerify(type, validList, invalidList, params, fn) {
- describe(type, function(){
+ describe(type, function() {
forEach(validList, function(value){
- it('should validate "' + value + '"', function(){
+ it('should validate "' + value + '"', function() {
setup(value);
expect(scope.$element).toBeValid();
});
});
forEach(invalidList, function(value){
- it('should NOT validate "' + value + '"', function(){
+ it('should NOT validate "' + value + '"', function() {
setup(value);
expect(scope.$element).toBeInvalid();
});
--
cgit v1.2.3