Commit graph

50 commits

Author SHA1 Message Date
Igor Minar
f5d08963b0 split mocks and create $log and $exceptionHandler mocks
- split mocks between angular-mocks.js and mocks.js
- src/angular-mocks.js now contains only mocks that we want to ship
- test/mocks.js contains mocks that we use internally for testing
  angular
- created angular.mock namespace
- created public $exceptionHandler mock rethrows errors
- created public $log mock stores all logs messages in an array that can
  be accessed to make assertions
- internally we now have factory to create $exceptionHandler
  that we can assert on
- internally we also keep track of all messages logged and
  fail tests if messages were not expected and cleaned up (checked
  via global beforeEach and afterEach)
- updated RakeFile and docs reader.js to point to the new
  angular-mocks.js location
- made real $exceptionHandler and $log factories accessible from tests
  and simplified their specs
- fixed typos in several spec descriptions
- added log assertions throughout the test suite
2011-01-26 15:46:05 -08:00
Misko Hevery
459a01e582 improved dump function to atomatically render HTML 2011-01-18 15:02:51 -08:00
Igor Minar
0a6cf70deb Rename angular.foreach to angular.forEach to make the api consistent.
camelcase is used for other angular functions and forEach is also
used by EcmaScript standard.

- rename the internal as well as the external function name
- tweak the implementation of the function so that it doesn't
  clober it self when we extend the angular object with an
  object that has a forEach property equal to this forEach function

Closes #85
2011-01-10 10:26:55 -08:00
Misko Hevery
47c454a315 change to keydown from keyup; add delayed $updateView
- There was a perceived lag when typing do to the fact that we were
   listening on the keyup event instead of keydown. The issue with
   keydown is that we can not read the value of the input field. To
   solve this we schedule a defer call and perform the model update
   then.

 - To prevent calling $eval on root scope too many times as well as to
   prevent drowning the browser with too many updates we now call the
   $eval only after 25ms and any additional requests get ignored. The
   new update service is called $updateView
2011-01-07 14:39:46 -08:00
Misko Hevery
fa722447f8 Fixed failed assignments of form abj[0].name=value
Closes #169
2010-12-08 14:20:26 -08:00
Misko Hevery
5a8ad8fe32 Closes #170. Corrected the behavior of select when options are ng:repeated
- Delete $postEval method, as it was a hack
2010-12-02 22:45:57 -08:00
Misko Hevery
62c0e5c460 Fix failing tests for ie, and mark elements as ng-widget, ng-directive, and ng-binding 2010-10-27 15:42:46 -07:00
Misko Hevery
4fdab37659 create HTML sanitizer to allow inclusion of untrusted HTML in safe manner.
Sanitization works in two phases:
 1) We parse the HTML into sax-like events (start, end, chars).
    HTML parsing is very complex, and so it may very well be that what
    most browser consider valid HTML may not pares properly here,
    but we do best effort. We treat this parser as untrusted.
 2) We have safe sanitizeWriter which treats its input (start, end, chars)
    as untrusted content and escapes everything. It only allows elements
    in the whitelist and only allows attributes which are whitelisted.
    Any attribute value must not start with 'javascript:'. This check
    is performed after escaping for entity (&xAB; etc..) and ignoring
    any whitespace.

 - Correct linky filter to use safeHtmlWriter
 - Correct html filter to use safeHtmlWriter

Close #33; Close #34
2010-10-26 13:41:07 -07:00
Misko Hevery
8a867cee22 Workaround for http://bugs.jquery.com/ticket/7292 2010-10-22 22:46:51 -07:00
Misko Hevery
01c7abab35 Fix browser triggering in scenario to always do native events.
- Also fixed angular.suffix for scenarios
 - refactored click() to browserTrigger()
 - Fixed Rakefile with CSS and jQuery
2010-10-19 15:56:53 -07:00
Misko Hevery
a36964799b fixed lint warnings and one flaky test 2010-10-15 13:44:53 -07:00
Elliott Sprehn
03df6cbddb New Angular Scenario runner and DSL system with redesigned HTML UI.
Uses the Jasmine syntax for tests, ex:

describe('widgets', function() {
  it('should verify that basic widgets work', function(){
    navigateTo('widgets.html');
    input('text.basic').enter('Carlos');
    expect(binding('text.basic')).toEqual('Carlos');
    input('text.basic').enter('Carlos Santana');
    expect(binding('text.basic')).not().toEqual('Carlos Boozer');
    input('text.password').enter('secret');
    expect(binding('text.password')).toEqual('secret');
    expect(binding('text.hidden')).toEqual('hiddenValue');
    expect(binding('gender')).toEqual('male');
    input('gender').select('female');
    expect(binding('gender')).toEqual('female');
  });
});

Note: To create new UI's implement the interface shown in angular.scenario.ui.Html.
2010-10-14 09:47:39 -07:00
Misko Hevery
006fd2ca25 HEAD is now at 10c0151 Fixes on issue when a SELECT has OPTION which are data bound (ie OPTION has repeater or OPTION.value is bound), then SELECT does not update to match the correct OPTION after the change in model (ie after the OPTION repeater unrolls or OPTION.value is changed.) 2010-09-21 19:20:34 +02:00
Misko Hevery
1087270c95 added better handling of ng:format=number 2010-08-18 16:04:40 -07:00
Shyam Seshadri
cf33105011 Fix toEqual matcher to use angular.equals instead of simple == comparison, which breaks down for arrays and objects 2010-08-12 02:45:22 +08:00
Misko Hevery
b2b170099f fix issues with ie 7 2010-07-23 13:54:12 -07:00
Misko Hevery
b5195b8f67 changed the eval for ie to be able to return a function 2010-07-02 17:26:26 -07:00
Misko Hevery
1f05621509 change all attributes from ng- to ng: prefix 2010-07-02 15:39:57 -07:00
Misko Hevery
5dda723185 improved handling of text fields when formater fails to prevent clobering of field 2010-05-10 20:24:20 -07:00
Misko Hevery
038a743e6f xhr bulk fixes 2010-05-07 12:09:14 -07:00
Misko Hevery
fce48eb60a resources now use browser mock 2010-04-27 11:18:08 -07:00
Misko Hevery
5fdb117b32 clean up failing test with jquery 2010-04-22 22:09:17 -07:00
Misko Hevery
7ef5e055af fix CI Build 2010-04-22 21:04:20 -07:00
Misko Hevery
fe434307d1 tests work under jquery and without 2010-04-22 17:11:56 -07:00
Misko Hevery
2a9669e1d8 working on jQuery passing tests 2010-04-22 15:50:20 -07:00
Misko Hevery
e78405f6ed more if tests pass 2010-04-21 12:50:05 -07:00
Misko Hevery
259c2bba4b last failing ie test remaining 2010-04-19 17:02:46 -07:00
Misko Hevery
9f9bdcf3d1 lint 2010-04-19 14:41:36 -07:00
Misko Hevery
618a2b423d ie fixes 2010-04-19 14:36:41 -07:00
Misko Hevery
70e401ef10 added $route service 2010-04-15 14:17:33 -07:00
Misko Hevery
e8ac57caae tests pass on chrome 2010-04-12 19:16:30 -07:00
Misko Hevery
2637d4e90c removed Meta and allowed binding of HTML 2010-04-12 14:28:15 -07:00
Misko Hevery
c4ef1f2fdd tests failing jstd to show cory 2010-04-08 13:43:40 -07:00
Misko Hevery
ee327a1f4f few fixes to make tests pass with jquery 2010-04-06 14:04:08 -07:00
Misko Hevery
1c670b2a7c added ng:include 2010-04-05 14:09:25 -07:00
Misko Hevery
7a4b480206 added ng:switch widget 2010-04-05 11:46:53 -07:00
Misko Hevery
a80a61839a injection is now working 2010-04-03 17:04:36 -07:00
Misko Hevery
35a9108500 all tests green, some dissabled 2010-03-31 13:57:25 -07:00
Misko Hevery
a7d62dcb55 more tests fixed 2010-03-30 14:55:04 -07:00
Misko Hevery
e55c97deba dissabled a lot of tests, and made the core test set pass. 2010-03-29 20:25:42 -07:00
Misko Hevery
cc71b745c3 added resources; removed compiled code 2010-03-15 14:36:50 -07:00
Misko Hevery
251fab4029 updateView is now called on binder instead of scope 2010-02-04 15:04:28 -08:00
Misko Hevery
1da18e73a4 consider widget errors only when widgets are visible 2010-02-04 13:27:56 -08:00
Misko Hevery
302472f4fa list formater always should return arry 2010-02-04 11:12:34 -08:00
Misko Hevery
a2540fd581 fixes to make it pass on IE 2010-01-25 23:49:52 -08:00
Misko Hevery
4460328bc1 lots of cleanup to get it ready for OS 2010-01-23 15:54:58 -08:00
Misko Hevery
595b4ea097 checkpoint for integration with angular 2010-01-18 10:47:03 -08:00
Misko Hevery
9b9a0dadcc removed nglr namespace 2010-01-09 15:02:43 -08:00
Misko Hevery
214c142d9d created a way to init the code without autobootstrap 2010-01-08 16:04:35 -08:00
Adam Abrons
c9c176a53b angular.js 2010-01-05 16:36:58 -08:00