From bf93953aafb475e7c381a15cd8e8b8a9cc97ee7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jordi=20Lo=CC=81pez?= Date: Tue, 21 Jun 2016 19:10:34 +0200 Subject: [PATCH] Added extension_for tag tests to builder test suite --- tests/builder.js | 9 +++++++++ tests/input/inherit/examplemodule.js | 29 ++++++++++++++-------------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/tests/builder.js b/tests/builder.js index 3133aebe..91acd8b2 100644 --- a/tests/builder.js +++ b/tests/builder.js @@ -161,6 +161,15 @@ suite.add(new YUITest.TestCase({ Assert.isObject(method.overwritten_from, 'Failed to find overwritten data'); }, item); }, + 'test: extension_for': function() { + var item = suite.data.classes['mywidget.SubWidget']; + Assert.isObject(item, 'Failed to parse class'); + suite.builder.renderClass(function (html, view, opts) { + var extension_for = opts.meta.extension_for; + Assert.isObject(extension_for, 'Failed to assign extension_for'); + Assert.areSame(1, extension_for.length, 'Failed to assign extension_for'); + }, item); + }, 'test: helper methods': function () { var item = suite.data.classes['mywidget.SuperWidget']; Assert.isObject(item, 'Failed to parse class'); diff --git a/tests/input/inherit/examplemodule.js b/tests/input/inherit/examplemodule.js index 8cf4ec3c..37440115 100644 --- a/tests/input/inherit/examplemodule.js +++ b/tests/input/inherit/examplemodule.js @@ -9,10 +9,10 @@ YUI.add('examplemodule', function (Y) { Y.namespace('mywidget'); - + /** * Superclass description.
This is a second line too. - * + * * @constructor * @class SuperWidget * @extends Widget @@ -23,15 +23,15 @@ YUI.add('examplemodule', function (Y) { * */ Y.mywidget.superwidget = Y.Base.create("mysuperwidget", Y.Widget, [], { - + /** * Supermethod description.
This is a second line. - * + * * @method myMethod * @async */ myMethod: function () {} - + /** * Overwritten method see {{#crossLink "mywidget.SuperWidget"}}{{/crossLink}} * also see {{#crossLink "mywidget.SuperWidget/myMethod"}}{{/crossLink}} @@ -83,36 +83,37 @@ YUI.add('examplemodule', function (Y) { * Override Event * @event init2 */ - + }, { - + }); - + /** * Subclass description. - * + * * @constructor * @namespace mywidget * @class SubWidget * @extends mywidget.SuperWidget + * @extensionfor mywidget.SuperWidget */ Y.mywidget.superwidget = Y.Base.create("mysuperwidget", Y.mywidget.superwidget, [], { - + /** * Submethod description. - * + * * @method myMethod * @param {boolean} d Foo */ myMethod: function () {} - + }, { - + }); /** * Subclass description. - * + * * @constructor * @namespace mywidget * @class SubWidget2