Commit graph

23 commits

Author SHA1 Message Date
Igor Minar
264f960800 added spec for auto bootstrap with #autobind 2010-11-09 19:58:42 -08:00
Igor Minar
1a43f36e23 Add isDate method + fix old code 2010-11-08 22:49:29 -08:00
Vojta Jina
f3ac2cd434 Update AngularSpec tests to use BDD style - jasmine expect 2010-11-07 14:42:04 -08:00
Vojta Jina
7779630989 Added tests for angular.service
- should allow to override a service
- should preserve angular properties on override
- should not preserve non-angular properties on override
2010-11-07 14:42:03 -08:00
Vojta Jina
00ca67e4be Issue #51: Update extensionMap()
If user override existing extension, angular properties ($) will be preserved.

This piece of logic could be refactored into separate method:
Something like we have extend(), addMissingProperties() - I can't find a name
for this method...

Closes #51
2010-11-07 14:42:03 -08:00
Elliott Sprehn
40d7e66f40 Lots of bug fixes in the scenario runner and a bunch of new features.
- By default the runner now creates multiple output formats as it runs. Nodes are created in the DOM with ids: json, xml, and html.

ex. $('#json').html() => json output of the runner
ex. $('#xml').html() => json output of the runner

$result is also an object tree result.

The permitted formats are html,json,xml,object.

If you don't want certain formats you can select specific ones with the new ng:scenario-output attribute on the script tag.

<script src="angular-scenario.js" ng:scenario-output="xml,json">

- Added element(...).count() that returns the number of matching elements for the selector.

- repeater(...).count() now returns 0 if no elements matched which can be used to check if a repeater is empty.

- Added toBe() matcher that does strict equality with ===

- Implement iit and ddescribe. If iit() is used instead of it() then only that test will run. If ddescribe() is used instead of describe() them only it() statements inside of it will run. Several iit/ddescribe() blocks can be used to run isolated tests.

- Implement new event based model for SpecRunner. You can now listen for events in the runner. This is useful for writing your own UI or connecting a remote process (ex. WebDriver). Event callbacks execute on the Runner instance.

Events, if fired, will always be in the below order. All events always happen
except for Failure and Error events which only happen in error conditions.

Events:
  RunnerBegin
  SpecBegin(spec)
  StepBegin(spec, step)
  StepError(spec, step, error)
  StepFailure(spec, step, error)
  StepEnd(spec, step)
  SpecError(spec, step, error)
  SpecEnd(spec)
  RunnerEnd

- Only allow the browser to repaint every 10 steps. Cuts 700ms off Firefox in benchmark, 200ms off Chrome.

- Bug Fix: Manually navigate anchors on click since trigger wont work in Firefox.
2010-10-26 15:17:57 -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
Igor Minar
6f3a757a37 Angular should look for angular-ie-compat file at the right location
The location should be based on the base path of the angular script
and the version identifier of the angular script.

ex: angular.js -> angular-ie-compat.js
    js/angular-0.9.0.min.js -> js/angular-ie-compat-0.9.0.js
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
Igor Minar
f24ec0c8f7 improving angular.copy spec 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
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
805753dba4 fixed issue where date copy creates an object instead of date 2010-10-13 12:47:10 -07:00
Igor Minar
81052d4a62 fixed lint warnings 2010-10-04 09:00:09 -07:00
Igor Minar
eb8d46d380 Differentiate between flags and empty keys in $location.hashSearch
* #foo?key=var&flag&emptyKey= should parse into
  {key:'val', flag: true, emptyKey: ''}
* added docs and spec for parseKeyValue function
2010-09-29 09:52:03 -07:00
Misko Hevery
7e96af0fdd added equals method to angular.equals and $equals 2010-07-19 12:29:24 -07:00
Misko Hevery
7cef4358ae fixed build 2010-07-15 14:16:04 -07:00
Misko Hevery
038a743e6f xhr bulk fixes 2010-05-07 12:09:14 -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
9d566fe98c missing test 2010-02-09 14:59:24 -08:00