aboutsummaryrefslogtreecommitdiffstats
path: root/src/widgets.js
diff options
context:
space:
mode:
authorMisko Hevery2010-11-05 15:05:24 -0700
committerMisko Hevery2010-11-05 15:05:24 -0700
commitdc66687149078876f3964a5ab0b9aa0434f46cdc (patch)
treef7b05721dcd9352f4641e73571ea2a38dd5d4ed0 /src/widgets.js
parent3d6a099d6e40f1e12f6349843218987d472d0f3c (diff)
downloadangular.js-dc66687149078876f3964a5ab0b9aa0434f46cdc.tar.bz2
added tests for documentation
Diffstat (limited to 'src/widgets.js')
-rw-r--r--src/widgets.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/widgets.js b/src/widgets.js
index 7a06fd6c..4845e694 100644
--- a/src/widgets.js
+++ b/src/widgets.js
@@ -268,6 +268,17 @@ angularWidget('option', function(){
* <ng:include src="url"></ng:include>
*
* @scenario
+ * it('should load date filter', function(){
+ * expect(element('.example ng\\:include').text()).toMatch(/angular\.filter\.date/);
+ * });
+ * it('should change to hmtl filter', function(){
+ * select('url').option('angular.filter.html.html');
+ * expect(element('.example ng\\:include').text()).toMatch(/angular\.filter\.html/);
+ * });
+ * it('should change to blank', function(){
+ * select('url').option('(blank)');
+ * expect(element('.example ng\\:include').text()).toEqual('');
+ * });
*/
angularWidget('ng:include', function(element){
var compiler = this,
@@ -328,6 +339,11 @@ angularWidget('ng:include', function(element){
* <any ng:switch-when="matchValueN"/>...</any>
*
* @param {*} on expression to match against <tt>ng:switch-when</tt>.
+ * @paramDescription
+ * On child elments add:
+ *
+ * * `ng:switch-when`: the case statement to match against. If match then this
+ * case will be displayed.
*
* @example
<select name="switch">
@@ -343,6 +359,13 @@ angularWidget('ng:include', function(element){
</code>
*
* @scenario
+ * it('should start in settings', function(){
+ * expect(element('.example ng\\:switch').text()).toEqual('Settings Div');
+ * });
+ * it('should change to home', function(){
+ * select('switch').option('home');
+ * expect(element('.example ng\\:switch').text()).toEqual('Home Span');
+ * });
*/
var ngSwitch = angularWidget('ng:switch', function (element){
var compiler = this,