aboutsummaryrefslogtreecommitdiffstats
path: root/test
AgeCommit message (Collapse)Author
2014-03-18test(ngMock): workaround issue with negative timestampsBrett Porter
In some specific timezones and operating systems, it seems that getTimezoneOffset() can return an incorrect value for negative timestamps, as described in #5017. While this isn't something easily fixed in the mock code, the tests can avoid that particular timeframe by using a positive timestamp. Closes #5017 Closes #6730
2014-03-18fix(select): avoid checking option element selected properties in renderJeff Balboni
In Firefox, hovering over an option in an open select menu updates the selected property of option elements. This means that when a render is triggered by the digest cycle, and the list of options is being rendered, the selected properties are reset to the values from the model and the option hovered over changes. This fix changes the code to only use DOM elements' selected properties in a comparison when a change event has been fired. Otherwise, the internal new and existing option arrays are used. Closes #2448 Closes #5994
2014-03-18fix(orderBy): support string predicates containing non-ident charactersCaitlin Potter
The orderBy filter now allows string predicates passed to the orderBy filter to make use property name predicates containing non-ident strings, such as spaces or percent signs, or non-latin characters. This behaviour requires the predicate string to be double-quoted. In markup, this might look like so: ```html <div ng-repeat="item in items | orderBy:'\"Tip %\"'"> ... </div> ``` Or in JS: ```js var sorted = $filter('orderBy')(array, ['"Tip %"', '-"Subtotal $"'], false); ``` Closes #6143 Closes #6144
2014-03-18fix(ngCookie): convert non-string values to stringCaitlin Potter
Previously, non-string values stored in $cookies would be removed, without warning the user, and causing difficulty debugging. Now, the value is converted to string before being stored, and the value is not dropped. Serialization may be customized using the toString() method of an object's prototype. Closes #6151 Closes #6220
2014-03-18fix(ngTouch): update workaround for desktop Webkit quirkChris Constantin
Fix click busting of input click triggered by a label click quickly following a touch event on a different element, in desktop and mobile WebKit To reproduce the issue fixed by this commit set up a page with - an element with ng-click - a radio button (with hg-model) and associated label In a quick sequence tap on the element and then on the label. The radio button will not be checked, unless PREVENT_DURATION has passed Closes #6302
2014-03-18fix($httpBackend): don't error when JSONP callback called with no parameterCaitlin Potter
This change brings Angular's JSONP behaviour closer in line with jQuery's. It will no longer treat a callback called with no data as an error, and will no longer support IE8 via the onreadystatechanged event. BREAKING CHANGE: Previously, the JSONP backend code would support IE8 by relying on the readystatechanged events. This is no longer the case, as these events do not provide adequate useful information for deeming whether or not a response is an error. Previously, a JSONP response which did not pass data into the callback would be given a status of -2, and treated as an error. Now, this situation will instead be given a status of 200, despite the lack of data. This is useful for interaction with certain APIs. Previously, the onload and onerror callbacks were added to the JSONP script tag. These have been replaced with jQuery events, in order to gain access to the event object. This means that it is now difficult to test if the callbacks are registered or not. This is possible with jQuery, using the $.data("events") method, however it is currently impossible with jqLite. This is not expected to break applications. Closes #4987 Closes #6735
2014-03-18fix($$RAFProvider): check for webkitCancelRequestAnimationFrameTraxmaxx
Android 4.3 only supports webkitCancelRequestAnimationFrame. Closes #6526
2014-03-18feat(ngMock.$httpBackend): added support for function as URL matcherCaio Cunha
It's now possible to pass a function to match the URL in $httpBackend mocked expectations. This gives a more sophisticate control over the URL matching without requiring complex RegExp mantainance or the workaround of creating an object with a `test` function in order to mimic RegExp interface. This approach was suggested in [this thread](https://groups.google.com/d/msg/angular/3QsCUEvvxlM/Q4C4ZIqNIuEJ) Closes #4580
2014-03-18feat($compile): add support for $observer deregistrationCaio Cunha
In order to make the behavior compatible with $rootScope.$watch and $rootScope.$on methods, and make it possible to deregister an attribute observer, Attributes.$observe method now returns a deregistration function instead of the observer itself. BREAKING CHANGE: calling attr.$observe no longer returns the observer function, but a deregistration function instead. To migrate the code follow the example below: Before: ``` directive('directiveName', function() { return { link: function(scope, elm, attr) { var observer = attr.$observe('someAttr', function(value) { console.log(value); }); } }; }); ``` After: ``` directive('directiveName', function() { return { link: function(scope, elm, attr) { var observer = function(value) { console.log(value); }; attr.$observe('someAttr', observer); } }; }); ``` Closes #5609
2014-03-18fix(Scope): $watchCollection should call listener with oldValueIgor Minar
Originally we destroyed the oldValue by incrementaly copying over portions of the newValue into the oldValue during dirty-checking, this resulted in oldValue to be equal to newValue by the time we called the watchCollection listener. The fix creates a copy of the newValue each time a change is detected and then uses that copy *the next time* a change is detected. To make `$watchCollection` behave the same way as `$watch`, during the first iteration the listener is called with newValue and oldValue being identical. Since many of the corner-cases are already covered by existing tests, I refactored the test logging to include oldValue and made the tests more readable. Closes #2621 Closes #5661 Closes #5688 Closes #6736
2014-03-18chore(log): add `log.empty()` method to the testing loggerIgor Minar
`log.empty()` is the same as `log.reset()`, except thati `empty()` also returns the current array with messages instead of: ``` // do work expect(log).toEqual(['bar']); log.reset(); ``` do: ``` // do work expect(log.empty()).toEqual(['bar']); ```
2014-03-17fix(jqLite): traverse `host` property for DocumentFragment in inheritedData()Caitlin Potter
If dealing with a document fragment node with a host element, and no parent, use the host element as the parent. This enables directives within a Shadow DOM or polyfilled Shadow DOM to lookup parent controllers. Closes #6637
2014-03-15fix($http): allow sending Blob data using $httpBruno Baia
Closes #5012
2014-03-14fix($http): don't covert 0 status codes to 404 for non-file protocolsPawel Kozlowski
PR #5547 introduced conversion of all 0 status codes to 404 for cases where no response was recieved (previously this was done for the file:// protocol only). But this mechanism is too eager and masks legitimate cases where status 0 should be returned. This commits reverts to the previous mechanism of handling 0 status code for the file:// protocol (converting 0 to 404) while retaining the returned status code 0 for all the protocols other than file:// Fixes #6074 Fixes #6155
2014-03-14fix($$rAF): always fallback to a $timeout incase native rAF isn't supportedMatias Niemelä
Closes #6654
2014-03-14fix(ngAnimate): setting classNameFilter disables animation inside ng-ifTomer Chachamu
Closes #6539
2014-03-10feat(): whitelist blob urls for sanitization of data-bound image urlsIgor Minar
Closes #4623
2014-03-07fix($compile): support templates with thead and tfoot root elementsLucas Galfasó
If the first element in a template is a <thead> or a <tfoot>, then use the existing logic to handle table elements compilation. Closes #6289
2014-03-06feat(input): support types date, time, datetime-local, month, weekBen Lesh
On older browser that don't support the new HTML5 inputs and display a text input instead, the user is required to enter the data in the corresponding ISO format. The value in `ng-model` will always be a date. E2e tests contain a workaround to a bug in webdriver, see https://github.com/angular/protractor/issues/562. Also adds weeks as format to the `dateFilter`. Related to #757. Closes #5864.
2014-03-06fix(style): expressions in style tagsSekib Omazic
Enable data-binding for style tags. Note: this feature does not work on IE8. Closes #2387 Closes #6492
2014-03-05style: enable jscs requireLeftStickedOperators ruleTimothée Jeannin
Closed #6544.
2014-02-28fix($animate): delegate down to addClass/removeClass if setClass is not foundMatias Niemelä
Closes #6463
2014-02-28feat($animate): animate dirty, pristine, valid, invalid for form/fieldsYves Brissaud
Add css animations when form or field status change to/from dirty, pristine, valid or invalid. This works like animation system present with ngClass, ngShow, etc. Closes #5378
2014-02-27fix(jqLite): properly toggle multiple classesPawel Kozlowski
Fixes #4467 Closes #6448
2014-02-27chore(qSpec): fix typosLajos Veres
2014-02-27chore(parseSpec): fix typoLajos Veres
2014-02-27chore(httpSpec): fix typoLajos Veres
2014-02-27chore(filtersSpec): fix typoLajos Veres
2014-02-27chore(ngRepeatSpec): fix typoLajos Veres
2014-02-27chore(AngularSpec): fix typoLajos Veres
2014-02-26fix($animate): ensure all comment nodes are removed during a leave animationMatias Niemelä
Closes #6403
2014-02-26fix($animate): only block keyframes if a stagger is set to occurMatias Niemelä
Transitions must be blocked so that the initial CSS class can be applied without triggering an animation. Keyframes do not need to be blocked since animations are always triggered on the starting CSS class, however, if a stagger animation is set to occur then all elements for index > 0 should be blocked. This is to prevent the animation from occuring early on before the stagger delay for the given element has passed. With ngAnimate and keyframe animations, IE10 and Safari will render a slight flicker effect caused by the blocking. This fix resolves this issue. Closes #4225
2014-02-26fix(ngAnimate): TypeError Cannot call method 'querySelectorAll' in ↵Stanislav Sysoev
cancelChildAnimations When an element containing both ng-repeat and ng-if directives attempts to remove any items from the repeat collection, the following error is thrown: "TypeError Cannot call method 'querySelectorAll' of undefined". This happens because the cancelChildAnimations code naively belives that the jqLite object always has an element node within it. The fix in this commit addresses to securely check to see if a node was properly extracted before any child elements are inspected. Closes #6205
2014-02-26fix($animate): ensure that animateable directives cancel expired leave ↵Matias Niemelä
animations If enter -> leave -> enter -> leave occurs then the first leave animation will animate alongside the second. This causes the very first DOM node (the view in ngView for example) to animate at the same time as the most recent DOM node which ends up being an undesired effect. This fix takes care of this issue. Closes #5886
2014-02-26test($animate): ensure staggering timeout tests are secureMatias Niemelä
2014-02-26fix($animate): ensure all animated elements are taken care of during the ↵Matias Niemelä
closing timeout Closes #6395
2014-02-25revert: fix($location): parse query string when path is empty in hashbang modeIgor Minar
This reverts commit cad717b1171affc3d540cea372576c70b0cb2295. This change causes regressions in existing code and after closer inspection I realized that it is trying to fix an issue that is should not be considered a valid issue. The location service was designed to work against either "hash" part of the window.location when in the hashbang mode or full url when in the html5 mode. This change tries to merge the two modes partially, which is not right. One reason for this is that the search part of window.location can't be modified while in the hashbang mode (a browser limitation), so with this change part of the search object should be immutable and read-only which will only cause more confusion. Relates to #5964
2014-02-26feat($parse): support trailing commas in object & array literalsMichał Gołębiowski
Per ECMAScript 5.1 specification trailing commas are allowed in object and array literals. All modern browsers as well as IE>8 support this syntax. This commit adds support for such syntax to Angular expressions.
2014-02-24perf($animate): use rAF instead of timeouts to issue animation callbacksMatias Niemelä
2014-02-24chore(core): create a wrapper to manage async callbacksMatias Niemelä
2014-02-24chore(core): introduce a wrapper for requestAnimationFrameMatias Niemelä
2014-02-22style(tests): remove trailing comma in specsChia-liang Kao
Closes #6241
2014-02-21fix($location): parse query string when path is empty in hashbang modeCaitlin Potter
Before this fix, search queries in hashbang mode were ignored if the hash was not present in the url. This patch corrects this by ensuring that the search query is available to be parsed by urlResolve when the hashbang is not present. Closes #5964
2014-02-21fix(isElement): reduce false-positives in isElement testsCaitlin Potter
Complimentary change to match changed $parse behaviour.
2014-02-21fix($parse): reduce false-positives in isElement testsCaitlin Potter
There are always going to be false positives here, unfortunately. But testing different properties will hopefully reduce the number of false positives in a meaningful way, without harming performance too much. Closes #4805 Closes #5675
2014-02-21feat(ngHref): bind ng-href to xlink:href for SVGAElementCaitlin Potter
This change makes the ngHref directive useful for SVGAElements by having it bind to the xlink:href attribute rather than the href attribute. Closes #5904
2014-02-21fix($http): do not add trailing questionBoris Serdyuk
Closes #6342
2014-02-21fix($http): send GET requests by defaultPawel Kozlowski
Fixes #5985 Closes #6401
2014-02-20chore(doc-gen): add formatted error messages to error pagesPeter Bacon Darwin
This got missed in the doc migration: When there is an error in an Angular app, extra information is placed in the URL, which can be used by the docs application to display a more useful message. This fix adds that back in. The error message templates are extracted by the minerr tool during build and put into the errors.json file. The errors-doc processor will load this up and attach these message templates to the error docs. The display of these templates was already in place, via the errorDisplay directive in docs/app/js/errors.js. (Also, moved the error.template.html file into the angular.js repository from the dgeni-packages repository as this is specific to the angular.js project and all the other error related stuff is in here. Finally, also, added an e2e test that checks that minerr formatted messages are displayed correctly. Closes #6363
2014-02-18style(jqLite): remove trailing whitespace in new testCaitlin Potter
Oops.