Commit graph

449 commits

Author SHA1 Message Date
Igor Minar
2e687ee56f Add support for version numbers in the Rakefile
* version number is stored in version.yaml
  - work in progress is marked with version number that ends with '-snapshot'
* all compiled files are stored in the './build/' directory without version numbers
* :package task creates a tarball in the build directory
  - if version number contains '-snapshot', this substring is replaced with sha of the head
  - tarball contains version number in the filename
  - all js files contain version number in the filename
* .gitignore was updated to reflect all these changes
* the .map file is not created by the closure compiler any more
2010-10-20 14:48:35 -07:00
Igor Minar
7530eea703 add missing spec for angularJsConfig 2010-10-20 14:48:35 -07:00
Igor Minar
644c8514c5 extract and test regexp that identifies angular script tag 2010-10-20 14:48:35 -07:00
Elliott Sprehn
2115db6903 Lots of stability and performance updates and UI polish too.
Polish the Scenario Runner UI to include:
- a scroll pane that steps appear in since the list can be very long
- Collapse successful tests
- Show the line where the DSL statements were when there's an error (Chrome, Firefox)

Also:
- Remove lots angular.bind calls to reduce the amount of stack space used.
- Use setTimeout(...,0) to schedule the next future to let the browser breathe and have it repaint the steps. Also prevents overflowing the stack when an it() creates many futures.
- Run afterEach() handlers even if the it() block fails.
- Make navigateTo() take a function as the second argument so you can compute a URL in the future.
- Add wait() DSL statement to allow interactive debugging of tests.
- Allow custom jQuery selectors with element(...).query(fn) DSL statement.

Known Issues:
- All afterEach() handlers run even if a beforeEach() handler fails. Only after handlers for the same level as the failure and above should run.
2010-10-20 14:38:00 -07:00
Misko Hevery
9c8b1800b9 fixed negative numbers in Json 2010-10-20 07:22:15 -07:00
Vojta Jina
a27198d52e Added tests for URL_MATCH and fixed issue with empty path
This commit was produced by a combination of 4 commits:
- Added URL_MATCH test for basic url
- Moved two tests from $location to URL_MATCH, as they should be here
- Added test for host without "/" ending and fix the regexp to pass the test
- Added another test for matching empty abs path ("/") and fix the regexp
2010-10-19 21:58:01 -07:00
Misko Hevery
286d1fe434 fix issue where script calls back before callback registered. 2010-10-19 21:03:34 -07:00
Misko Hevery
c5cfe2b393 fix date filter to igrone falsy input 2010-10-19 20:38:49 -07:00
Misko Hevery
a0ac6725ed fixed Scenario.js so that it does not clobber global vars 2010-10-19 16:25:23 -07:00
Misko Hevery
406373b5db fixed tests 2010-10-19 16:14:16 -07:00
Misko Hevery
977cb7e03e upgrade jstd 2010-10-19 16:02:41 -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
Elliott Sprehn
e7e894a2e3 Significantly clean up the way the scenario DSL works and implement many more DSL statements.
- "this" always means the current chain scope inside a DSL

- addFutureAction callbacks now take ($window, $document, done)

- $document has a special method elements() that uses the currently selected nodes in the document as defined by using() statements.

- $document.elements() allows placeholder insertion into selectors to make them more readable.
  ex. $document.elements('input[name="$1"]', myVar) will substitute the value of myVar for $1 in the selector. Subsequent arguments are $2 and so on.

- $document.elements() results have a special method trigger(event) which should be used to events. This method implements some hacks to make sure browser UI controls update and the correct angular events fire.

- futures now allow custom formatting. By default any chain that results in a future can use toJson() or fromJson() to convert the future value to and from json. A custom parser can be provided with parsedWith(fn) where fn is a callback(value) that must return the parsed result.

Note: The entire widgets.html UI is now able to be controlled and asserted through DSL statements!!! Victory! :)
2010-10-19 00:45:38 -07:00
Igor Minar
a1fa23397f small fixes to the $location services
* fixing the jsdoc format
* rewriting updateHash() method to be easier to read and so that
  it minifies better
2010-10-18 22:24:44 -07:00
Igor Minar
ffb968b08b Remove externs target from the Rakefile
We are not going to do advanced optimization in the forseeable
future, so until then we don't need we should remove them from
Rakefile.
2010-10-18 16:24:44 -07:00
Igor Minar
4bef371e5a fixing css class name for currency filter and its spec 2010-10-18 16:24:43 -07:00
Igor Minar
7059579c74 inline all images into css
* embedded images as data URIs
* rake task to generate multipart js file with embeded images for IE
* move images into a separate directory outside of src or css and
  keep them there for reference
* clean up Rakefile and ruby code
* .gitignore update
* don't penalize IE 8+ with an extra request to the ie-compat.js file
2010-10-18 16:24:43 -07:00
Vojta Jina
d0e55bf446 Removed $location.cancel() method (and related test) 2010-10-18 14:13:48 -07:00
Vojta Jina
1cad16c6f9 Update $location API Close #62
update(objOrString)
updateHash(objOrString [, objOrString])
toString()
cancel()

Examples:
$location.update('http://www.angularjs.org/path#path?a=b');
$location.update({port: 443, protocol: 'https'});
$location.updateHash('hashPath');
$location.updateHash({a: 'b'});
$location.updateHash('hashPath', {a: 'b'});

This commit was produced by squash of more commits, here are the old messages:

- Change tests to use update() instead of parse().
- First implementation of update() method
- Test for update() with object parameter
- Add new tests for location, refactor location code
- Add tests for updateHash()
- Implement updateHash()
- Take one or two arguments, could be string - update hashPath, or hash object - update hashSearch...
- Fixed other service tests, to use new $location.update()
Added $location.cancel() method (with test)
Added $location.parse() for back compatability
Remove parse() method
2010-10-18 10:04:15 -07:00
Vojta Jina
341b2b3a9b Update $location API Close #62
update(objOrString)
updateHash(objOrString [, objOrString])
toString()
cancel()

Examples:
$location.update('http://www.angularjs.org/path#path?a=b');
$location.update({port: 443, protocol: 'https'});
$location.updateHash('hashPath');
$location.updateHash({a: 'b'});
$location.updateHash('hashPath', {a: 'b'});

This commit was produced by squash of more commits, here are the old messages:

- Change tests to use update() instead of parse().
- First implementation of update() method
- Test for update() with object parameter
- Add new tests for location, refactor location code
- Add tests for updateHash()
- Implement updateHash()
- Take one or two arguments, could be string - update hashPath, or hash object - update hashSearch...
- Fixed other service tests, to use new $location.update()
Added $location.cancel() method (with test)
Added $location.parse() for back compatability
Remove parse() method
2010-10-18 09:58:37 -07:00
Misko Hevery
9e9bdbdc40 JSON parser is now strict (ie, expressions are not allowed for security)
Close #57
2010-10-18 08:50:36 -07:00
Misko Hevery
352dbfa38f upgraded jasmine to 1.0.1
Close #63
2010-10-17 21:13:28 -07:00
Igor Minar
f24ec0c8f7 improving angular.copy spec 2010-10-16 22:10:01 -07:00
Igor Minar
54090d7766 ng:include should remove the reference to childScope when src is blank 2010-10-16 22:10:01 -07:00
Vojta Jina
b08e2be64c Pass the toKeyValue() test - parsing flags 2010-10-16 22:10:01 -07:00
Vojta Jina
46c6406b25 Add test for toKeyValue() - true values should be composed to flag 2010-10-16 22:10:01 -07:00
Vojta Jina
732bcd8a36 Add missing tests for toKeyValue() function 2010-10-16 22:10:01 -07:00
Misko Hevery
ce49c361d7 attempting to fix ie on jquery build failure 2010-10-16 22:08:58 -07:00
Misko Hevery
b96f736951 fixed date formater and make it work on ie 2010-10-16 21:43:28 -07:00
Igor Minar
f8865459d5 adding an extra DateToUTC assertion 2010-10-16 21:31:23 -07:00
Vojta Jina
312f93574e Fixed filter date test - remove dependency on machine timezone
It would be better to separate the time-zone logic to a separate unit and test just this logic.
This logic is simply convert minutes to HH:MM, the source of time-zone is from date object...
2010-10-16 21:29:30 -07:00
Misko Hevery
ff52f47537 Fix unicode parsing Close #56 2010-10-15 14:06:30 -07:00
Misko Hevery
a36964799b fixed lint warnings and one flaky test 2010-10-15 13:44:53 -07:00
Misko Hevery
d320e3d2c3 Updated JSTD 2010-10-15 11:58:55 -07:00
Misko Hevery
de66a319b4 removed unneeded function rethrow from scope which was interfering with the test rethrow function 2010-10-15 10:55:58 -07:00
Misko Hevery
7903f4d940 use new Function instead of eval()
Close #52
2010-10-14 21:49:59 -07:00
Misko Hevery
a7da160c1d publish $route since we bind it with $route.current in ng:include 2010-10-14 15:44:14 -07:00
Misko Hevery
d9c8284ea5 removed stray console.log 2010-10-14 14:52:12 -07:00
Igor Minar
692333f2f5 temporary backwards compatibility patch for 2010-10-14 12:36:29 -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
0f104317df Added support for date filter
Date filter now supports:
yyyy: four digit year
  yy: two digit year
  MM: two digit month
  dd: two digit day of month
  HH: two digit hour in 0-23
  KK: two digit hour in 0-12
  mm: two digit minute
  ss: two digit second
   a: am/pm
   Z: four digit timezone offset

example {{ timestamp | date:'yyyy-MM-dd HH:mm:ss' }} becomes 2010-10-13 14:45:23
2010-10-13 23:15:40 -07:00
Igor Minar
1cc85a77cf fixing reference issue in angular-mocks.js 2010-10-13 17:42:55 -07:00
Igor Minar
80c64b48f3 fix Rakefile - add Injector.js to :compile 2010-10-13 17:42:55 -07:00
Igor Minar
818b507d3c updating file list for the :package rake task
- removing angular-scenario.css (it's already inlined in the js)
- adding angular-mocks.js
2010-10-13 17:42:49 -07:00
Igor Minar
075bdf2316 adding angular logo 2010-10-13 17:32:45 -07:00
Misko Hevery
805753dba4 fixed issue where date copy creates an object instead of date 2010-10-13 12:47:10 -07:00
Misko Hevery
3ab49538a4 fixed issue where ng:bind would not reset value if expression returned undefined 2010-10-13 10:51:16 -07:00
Misko Hevery
2cb9497d02 Fixed issue where compiler would pass in detached text node if previous markup would have removed it. 2010-10-12 21:52:04 -07:00
Misko Hevery
d9abfe8a7e Introduced injector and $new to scope, and injection into link methods and controllers
- added angular.injector(scope, services, instanceCache) which returns inject
    - inject method can return, instance, or call function which have $inject
      property
    - initialize services with $creation=[eager|eager-publish] this means that
      only some of the services are now globally accessible
  - upgraded $become on scope to use injector hence respect the $inject property
    for injection
    - $become should not be run multiple times and will most likely be removed
      in future version
  - added $new on scope to create a child scope
     - $inject is respected on constructor function
  - simplified scopes so that they no longer have separate __proto__ for
    parent, api, behavior and instance this should speed up execution since
    scope will now create one __proto__ chain per scope (not three).

BACKWARD COMPATIBILITY WARNING:
  - services now need to have $inject instead of inject property for proper
    injection this breaks backward compatibility
  - not all services are now published into root scope
    (only: $location, $cookie, $window)
  - if you have widget/directive which uses services on scope
    (such as this.$xhr), you will now have to inject that service in
    (as it is not published on the root scope anymore)
2010-10-12 16:33:06 -07:00
Igor Minar
fbfd160316 adding :package task to the rake file 2010-10-12 16:28:46 -07:00