Commit graph

470 commits

Author SHA1 Message Date
Di Peng
9fdb09ebf8 added input#val method
Closes #237
2011-06-06 12:49:46 -07:00
Di Peng
1eebb771e3 renamed $pause to $sleep AND $wait to $pause
Closes #207
2011-06-05 12:00:45 -07:00
Vojta Jina
9a69677551 Fix CSS tests on Opera
Opera translates name colors to numbers (red -> #ff0000)
Other browsers like FF or Chrome translate number to rgb (#ff0000 -> rgb(255, 0, 0)
So avoiding colors in tests is probably the easiest solution...
2011-06-02 12:51:12 -07:00
Vojta Jina
dad2603752 Refactor $browser's lazy start polling
+ unit tests
2011-06-02 10:50:43 -07:00
Vojta Jina
50076b571d Fix hashchange event on IE8 compatibility mode
Stupid IE8 in compatibility mode or in IE7 mode returns true for `('onhashchange' in window)`, but does not support hashchange event.

Closes #353
2011-06-02 10:50:39 -07:00
Vojta Jina
aa64d37a23 Fix unit test in IE7 2011-06-02 08:55:10 -07:00
Vojta Jina
2e5199997c Rename deprecated wasCalled() -> toHaveBeenCalled() in all specs
As well as wasNotCalled(), wasCalledWith(), wasNotCalledWith()
2011-05-31 10:32:54 +02:00
Vojta Jina
b2f5299e0e Normalize IE XHR bug (status code 1223 to 204)
See http://bugs.jquery.com/ticket/1450
2011-05-31 10:23:30 +02:00
Vojta Jina
805e083c24 Remove trailing white spaces from all source files
find . -name "*.js" -print | xargs sed -Ei s/[[:space:]]*$//
2011-05-19 09:43:56 -07:00
Vojta Jina
1abdc097b2 JSTD adapter for running e2e tests
Couple of changes into angular.scenario runner:
 - add autotest config (runs tests when document ready)
 - update ObjectModel (forwards events)
 - use only one ObjectModel instance for all outputters
 - expose error msg and line number in ObjectModel.Spec and ObjectModel.Step
 - fix generating spec.ids
 - fix 'html' output so that it does not mutate ObjectModel

Couple of changes into docs / generator:
 - rename copy -> copyTpl
 - move docs/static into docs/examples (to avoid conflict with jstd proxy)

Running all docs e2e tests:
========================================================
1/ compile angular-scenario, jstd-scenario-adapter
>> rake compile

2/ build docs
>> rake docs

3/ start jstd server
>> ./server-scenario.sh

4/ capture some browser

5/ run node server to serve static content
>> node ../lib/nodeserver/server.js

6/ run tests
>> ./test-scenario.sh
2011-05-19 09:43:56 -07:00
Vojta Jina
9f56af9c15 XHR should add Content-type header only for POST
Sending Content-type header causes JSTD (Jetty) proxy to change GET methods into POST.
2011-05-19 09:43:56 -07:00
Vojta Jina
c5f0342ad8 Don't check url (by HEAD request) before navigateTo
Removed angular.scenario.Application.checkUrlStatus_ method and these tests:
* should call error handler if status check fails
* should perform a HEAD request to verify file existence
* should call error handler if status code is less than 200
* should call error handler if status code is greater than 299
* should call error handler if status code is greater than 299
2011-05-19 09:43:56 -07:00
Vojta Jina
f85c82acd6 Fix some typos, missing semi-colons, etc...
This is a combination of 4 commits:
* Fix some small typos, missing semi-colons, etc.
* Fix comment for angular.scenario.SpecRunner.run method
* Fixed some missing semi-colons in cookbook
* Fixed missing semi-colon in nodeserver/server.js
2011-04-25 08:17:17 -07:00
Igor Minar
3d388498e5 add test for ng:view sync cache regression
test for 9bd2c396
2011-04-11 08:04:16 -07:00
Igor Minar
9462b556a3 fix build for IE9
all unit tests now pass under IE9
2011-04-09 00:16:44 -07:00
Igor Minar
8e6ecd98ae fix e2e runner tests 2011-04-08 10:16:56 -07:00
Igor Minar
0d2d7025e6 use special nodeName_ impl only for IE<9
apparently IE9 is one step closer to becoming a real browser by
treating xmlns-like ("foo:") prefixes in node names as part of the
node name.

fixes:
https://groups.google.com/forum/?lnk=srg#!topic/angular/TGdrV4GsL8U
2011-04-07 14:56:57 -07:00
Igor Minar
754d2541c4 correct $resource's success callback execution
succcess callbacks should be executed for status codes in the range
of <200,300).
2011-04-04 16:04:37 -07:00
Igor Minar
78a0f41058 encode query params correctly but not too agressively 2011-03-31 21:45:28 -07:00
Igor Minar
eccd9bfbb3 add much needed whitespace to jqLiteSpec.js
can we agree to put more white space into our code?

I follow there rules for specs:

- 1 blank line between sections of nontrivial it block
- 2 blank lines between it blocks
- 2 blank lines between describe blocks
- 2 blank lines between beforeEach and afterEach
- no blank line between describe and the first child it
- no blank lines between two or more closing }); lines
2011-03-31 01:42:42 -07:00
Igor Minar
2d9dd1c172 add specs for jqLite wrapping/node creation
tests cover:
- creating comment tags from a string
- creating script tag from a string
- wrapping document fragment
2011-03-31 01:20:20 -07:00
Igor Minar
a2c4271128 ignore jqLite#append for doc fragment
this is needed to be compatible with jqQuery 1.5.1
2011-03-31 01:19:07 -07:00
Igor Minar
56c00800c7 fix jqLite#parent to be compatible with jQuery
our original implementation doesn't work with
document fragments on IE

- tests were added to cover missing cases
2011-03-31 01:17:34 -07:00
Igor Minar
a4863d5244 correct size() impl for object's w/ 'length' prop
the original implementation returned incorrect value value for
objects with 'length' property.
2011-03-30 15:24:03 -07:00
Igor Minar
96a1df192a extend size() to take ownPropsOnly param
- extend size() to take size(obj, ownPropsOnly)
- add specs for size()
- update docs to mention string support
- use size() in ng:repeat

including the hasOwnProp check for all object doesn't create
significant perf penalty:
http://jsperf.com/dedicated-code-branch-for-hasownprop
2011-03-30 15:24:03 -07:00
Igor Minar
c06c5a36b1 make xhr.cache optionally synchronous
- add `sync` flag xhr.cache
- change ng:include to use the sync flag
- change ng:view to use the sync flag

The end result is that there are fewer repaints in the browser,
which means less "blinking" that user sees.
2011-03-30 15:22:22 -07:00
Igor Minar
9985104dc0 remove weird spaces from resource mutation test 2011-03-30 15:22:14 -07:00
Anthony Lieuallen
94514a91f8 Don't mutate resource if server responded with no body
If the server provides response with no body to a resource request,
resource should not mutate the resource model in the callback.
2011-03-29 00:25:22 -07:00
Igor Minar
e1d122a4b7 encode $resource query params using encodeURIComponent 2011-03-28 23:33:46 -07:00
Igor Minar
885c3ad5dd fixing lint warnings 2011-03-28 23:15:28 -07:00
Vojta Jina
9312bed472 Added missing semi-colons
So that my eclipse stops complaining...
2011-03-28 23:04:48 -07:00
Igor Minar
1e59822df7 remove _null and _undefined
they have no significant effect on minified and gziped size. in fact
they make things worse.

file        | before     | after removal
----------------------------------------
concat      | 325415     | 325297
min         | 62070      | 62161
min + gzip  | 25187      | 25176

The bottom line is that we are getting 0.05% decrease in size after
gzip without all of the hassle of using underscores everywhere.
2011-03-26 23:19:04 -07:00
Misko Hevery
0084cb5ca4 Remove the script tag after successful JSONP request 2011-03-11 14:16:53 -08:00
Misko Hevery
c578f8c3ed Added XSRF prevention logic to $xhr service 2011-03-11 14:16:53 -08:00
Misko Hevery
d19c0ac6d3 Changed the $browser.xhr parameter post from optional to required 2011-03-11 14:16:52 -08:00
Misko Hevery
5343deb3da Consider all 2xx responses as OK, not just 200 2011-03-11 14:16:52 -08:00
Misko Hevery
26bad2bf87 Fixed cookies which contained unescaped '=' would not show up in cookie service. 2011-03-11 14:16:52 -08:00
Igor Minar
d304b0c3df fix failing autobind test on IE 2011-03-11 09:30:53 -08:00
Igor Minar
9d5c533791 ng:autobind now optionally takes element id
so it is possible to easily compile just a part of a document.

e.g.:

<html>
  <head>
    <title>partially compiled doc</title>
    <script src="angular.js" ng:autobind="compileThis"></script>
  </head>
  <body>
    this part won't be compiled: {{1+2}}
    <div id="compileThis" ng:init="i=0" ng:click="i = i+1">
      Click count: {{i}}
    </div>
  </body>
</html>
2011-03-11 08:45:43 -08:00
Igor Minar
7414e7b533 angularJsConfig now allows ng:autobind and #autobind value to be passed in 2011-03-11 08:45:16 -08:00
Igor Minar
cd139f5767 $xhr service now autodetects and strips )]}',\n
")]}\',\n" is a commonly used security prefix added to json http
responses iat google and elsewhere in order to prevent certain
cross-site attacks

$xhr service now autodetects the prefix and strips it before
deserializing the json.

the implementation should be more flexible to allow for wider range
of prefixes, but we need this one right now and can address other
usecases later.
2011-03-02 22:56:14 -08:00
Igor Minar
945056b166 linking function should return bound scope
angular.compile()() returns {scope:scope, view:view},
this isn't useful at all and only makes tests more verbose.
Instead, this change makes the linking function return scope directly
and if anyone needs the linked dom there are two ways to do it
documented in angular.compile.

other changes:
- moved angular.compile docs to the compiler so that they are closer to
  the compiler
- fixed some typos and updated angular.compile docs with the new return
  value
2011-03-01 17:09:25 -08:00
Igor Minar
a709dc19b8 adding an extra injector spec
- added a spec for dependency graph resolution
- also simplyfying cache presence check
2011-02-27 16:19:21 -08:00
Misko Hevery
edbe9d8ca8 Added delay parameter to the $defer service 2011-02-25 11:30:22 -08:00
Misko Hevery
9e67da420b Corrected an issue where properties inherited from __proto__ show up in ng:repeat.
Closses #112
2011-02-25 09:23:30 -08:00
Misko Hevery
c7998f5f99 add class on any namespace elments 2011-02-22 15:23:08 -08:00
Misko Hevery
5a3c9190dc correct hashchange event registration on window 2011-02-19 20:39:46 -08:00
Misko Hevery
e160944bfa fix test which fails on CI build, because the image has size 2011-02-19 20:37:17 -08:00
Misko Hevery
87cbf9f591 Remove ng:watch
Closes#143
2011-02-18 14:22:51 -08:00
Misko Hevery
fd6e5e3f31 replace smart-quotes with regular quotes 2011-02-18 14:02:21 -08:00