Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit e4a0062

Browse files
Di Pengmhevery
Di Peng
authored andcommitted
Should have replaced all instances of element('input[name=something]').val() with input('name').val()
Closes #376
1 parent 91a34a7 commit e4a0062

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/markups.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,32 +170,32 @@ angularTextMarkup('option', function(text, textNode, parentElement){
170170
<doc:scenario>
171171
it('should execute ng:click but not reload when href without value', function() {
172172
element('#link-1').click();
173-
expect(element('input[name=value]').val()).toEqual('1');
173+
expect(input('value').val()).toEqual('1');
174174
expect(element('#link-1').attr('href')).toBe("");
175175
});
176176
177177
it('should execute ng:click but not reload when href empty string', function() {
178178
element('#link-2').click();
179-
expect(element('input[name=value]').val()).toEqual('2');
179+
expect(input('value').val()).toEqual('2');
180180
expect(element('#link-2').attr('href')).toBe("");
181181
});
182182
183183
it('should execute ng:click and change url when ng:href specified', function() {
184184
element('#link-3').click();
185-
expect(element('input[name=value]').val()).toEqual('3');
185+
expect(input('value').val()).toEqual('3');
186186
expect(element('#link-3').attr('href')).toBe("#123");
187187
expect(browser().location().hash()).toEqual('123');
188188
});
189189
190190
it('should execute ng:click but not reload when href empty string and name specified', function() {
191191
element('#link-4').click();
192-
expect(element('input[name=value]').val()).toEqual('4');
192+
expect(input('value').val()).toEqual('4');
193193
expect(element('#link-4').attr('href')).toBe("");
194194
});
195195
196196
it('should execute ng:click but not reload when no href but name specified', function() {
197197
element('#link-5').click();
198-
expect(element('input[name=value]').val()).toEqual('5');
198+
expect(input('value').val()).toEqual('5');
199199
expect(element('#link-5').attr('href')).toBe(undefined);
200200
});
201201

src/service/location.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var URL_MATCH = /^(file|ftp|http|https):\/\/(\w+:{0,1}\w*@)?([\w\.-]*)(:([0-9]+)
3939
</doc:source>
4040
<doc:scenario>
4141
it('should initialize the input field', function() {
42-
expect(using('.doc-example-live').element('input[name=$location.hash]').val()).
42+
expect(using('.doc-example-live').input('$location.hash').val()).
4343
toBe('!/api/angular.service.$location');
4444
});
4545
@@ -52,14 +52,14 @@ var URL_MATCH = /^(file|ftp|http|https):\/\/(\w+:{0,1}\w*@)?([\w\.-]*)(:([0-9]+)
5252
5353
it('should set the hash to a test string with test link is presed', function() {
5454
using('.doc-example-live').element('#ex-test').click();
55-
expect(using('.doc-example-live').element('input[name=$location.hash]').val()).
55+
expect(using('.doc-example-live').input('$location.hash').val()).
5656
toBe('myPath?name=misko');
5757
});
5858
5959
it('should reset $location when reset link is pressed', function() {
6060
using('.doc-example-live').input('$location.hash').enter('foo');
6161
using('.doc-example-live').element('#ex-reset').click();
62-
expect(using('.doc-example-live').element('input[name=$location.hash]').val()).
62+
expect(using('.doc-example-live').input('$location.hash').val()).
6363
toBe('!/api/angular.service.$location');
6464
});
6565

0 commit comments

Comments
 (0)