From 6f91ffeb914e3a3670d675397cbdbff5cf590edd Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Tue, 3 Jan 2012 14:49:41 -0800 Subject: style: prefer single quotes + some whitespaces --- test/BinderSpec.js | 84 +++++++++++++++++++++++++++--------------------------- 1 file changed, 42 insertions(+), 42 deletions(-) (limited to 'test/BinderSpec.js') diff --git a/test/BinderSpec.js b/test/BinderSpec.js index 34504b30..efe7215b 100644 --- a/test/BinderSpec.js +++ b/test/BinderSpec.js @@ -49,50 +49,50 @@ describe('Binder', function() { })); it('ReplaceBindingInTextWithSpan preserve surounding text', function() { - expect(this.compileToHtml("a{{b}}c")).toBe('ac'); + expect(this.compileToHtml('a{{b}}c')).toBe('ac'); }); it('ReplaceBindingInTextWithSpan', function() { - expect(this.compileToHtml("{{b}}")).toBe(''); + expect(this.compileToHtml('{{b}}')).toBe(''); }); it('BindingSpaceConfusesIE', inject(function($rootScope, $compile) { if (!msie) return; - var span = document.createElement("span"); + var span = document.createElement('span'); span.innerHTML = ' '; var nbsp = span.firstChild.nodeValue; - expect(this.compileToHtml("{{a}} {{b}}")). + expect(this.compileToHtml('{{a}} {{b}}')). toBe('' + nbsp + ''); dealoc(($rootScope)); - expect(this.compileToHtml("{{A}} x {{B}} ({{C}})")). + expect(this.compileToHtml('{{A}} x {{B}} ({{C}})')). toBe('' + nbsp + 'x ' + '' + nbsp + '()'); })); it('BindingOfAttributes', inject(function($rootScope, $compile) { - var element = $compile("")($rootScope); - var attrbinding = element.attr("ng:bind-attr"); + var element = $compile('')($rootScope); + var attrbinding = element.attr('ng:bind-attr'); var bindings = fromJson(attrbinding); - expect(decodeURI(bindings.href)).toBe("http://s/a{{b}}c"); + expect(decodeURI(bindings.href)).toBe('http://s/a{{b}}c'); expect(bindings.foo).toBeFalsy(); })); it('MarkMultipleAttributes', inject(function($rootScope, $compile) { var element = $compile('')($rootScope); - var attrbinding = element.attr("ng:bind-attr"); + var attrbinding = element.attr('ng:bind-attr'); var bindings = fromJson(attrbinding); - expect(bindings.foo).toBe("{{d}}"); - expect(decodeURI(bindings.href)).toBe("http://s/a{{b}}c"); + expect(bindings.foo).toBe('{{d}}'); + expect(decodeURI(bindings.href)).toBe('http://s/a{{b}}c'); })); it('AttributesNoneBound', inject(function($rootScope, $compile) { - var a = $compile("")($rootScope); - expect(a[0].nodeName).toBe("A"); - expect(a.attr("ng:bind-attr")).toBeFalsy(); + var a = $compile('')($rootScope); + expect(a[0].nodeName).toBe('A'); + expect(a.attr('ng:bind-attr')).toBeFalsy(); })); it('ExistingAttrbindingIsAppended', inject(function($rootScope, $compile) { - var a = $compile("")($rootScope); + var a = $compile('')($rootScope); expect(a.attr('ng:bind-attr')).toBe('{"b":"{{def}}","href":"http://s/{{abc}}"}'); })); @@ -117,7 +117,7 @@ describe('Binder', function() { })); it('InputTypeButtonActionExecutesInScope2', inject(function($rootScope, $compile) { - var log = ""; + var log = ''; var element = $compile('')($rootScope); $rootScope.action = function() { log += 'click;'; @@ -143,8 +143,8 @@ describe('Binder', function() { '
Hello {{name}}!')($rootScope);
- $rootScope.name = "World";
+ $rootScope.name = 'World';
$rootScope.$apply();
expect( sortedHtml(element)).toBe(
@@ -492,7 +492,7 @@ describe('Binder', function() {
var errorLogs = $log.error.logs;
browserTrigger(first, 'click');
- expect($rootScope.greeting).toBe("ABC");
+ expect($rootScope.greeting).toBe('ABC');
expect(errorLogs).toEqual([]);
browserTrigger(second, 'click');
@@ -511,16 +511,16 @@ describe('Binder', function() {
var male = jqLite(element[0].childNodes[1]);
browserTrigger(female);
- expect($rootScope.sex).toBe("female");
+ expect($rootScope.sex).toBe('female');
expect(female[0].checked).toBe(true);
expect(male[0].checked).toBe(false);
- expect(female.val()).toBe("female");
+ expect(female.val()).toBe('female');
browserTrigger(male);
- expect($rootScope.sex).toBe("male");
+ expect($rootScope.sex).toBe('male');
expect(female[0].checked).toBe(false);
expect(male[0].checked).toBe(true);
- expect(male.val()).toBe("male");
+ expect(male.val()).toBe('male');
}));
it('ItShouldRepeatOnHashes', inject(function($rootScope, $compile) {
@@ -539,9 +539,9 @@ describe('Binder', function() {
it('ItShouldFireChangeListenersBeforeUpdate', inject(function($rootScope, $compile) {
var element = $compile('')($rootScope);
- $rootScope.name = "";
- $rootScope.$watch("watched", "name=123");
- $rootScope.watched = "change";
+ $rootScope.name = '';
+ $rootScope.$watch('watched', 'name=123');
+ $rootScope.watched = 'change';
$rootScope.$apply();
expect($rootScope.name).toBe(123);
expect(sortedHtml(element)).toBe('