diff options
author | Rogelio Mita <rogeliomita@activitycentral.com> | 2013-07-22 14:04:12 (GMT) |
---|---|---|
committer | Rogelio Mita <rogeliomita@activitycentral.com> | 2013-07-22 17:52:09 (GMT) |
commit | 900fe8c49fb08f275154e7dfc1591a6cdb175c1d (patch) | |
tree | 4ba5f41849b973172298c8fb7495598e3d832fb6 | |
parent | 3dbebe72938684e85dfe8d26b5be558012362f98 (diff) |
Dynamic structure test refactoring
-rw-r--r-- | webapp/js_tests/fixtures/container.html | 19 | ||||
-rw-r--r-- | webapp/js_tests/spec/DynamicStructureSpec.js | 23 |
2 files changed, 30 insertions, 12 deletions
diff --git a/webapp/js_tests/fixtures/container.html b/webapp/js_tests/fixtures/container.html index 1037a46..cf1fb9a 100644 --- a/webapp/js_tests/fixtures/container.html +++ b/webapp/js_tests/fixtures/container.html @@ -6,8 +6,21 @@ <script> var container = $('#WGroupContainer'), - WIDGET_TYPES = [{'0': {'key': 'TextInput', 'value': 'Respuesta de texto'}}], - WITH_OPTIONS = ["MultipleCheckBox", "DropDownList", "RadioButton"], - OFFSET_OPTION_ID = 1; + WIDGET_TYPES = [{ + '0': {'key': 'TextInput', 'value': 'Texto'}, + '1': {'key': 'MultipleCheckBox', 'value': 'Checklist (multiple opción)'}, + '2': {'key': 'RadioButton', 'value': 'Checklist (única respuesta)'}, + '3': {'key': 'DropDownList', 'value': 'Despliegue de lista (única respuesta)'}, + '4': {'key': 'ImageCheckBox', 'value': 'Checklist con imágenes (multiple opción)'}, + '5': {'key': 'ImageRadioButton', 'value': 'Checklist con imágenes (única respuesta)'}, + }], + WITH_OPTIONS = [ + "MultipleCheckBox", + "DropDownList", + "RadioButton", + "ImageCheckBox", + "ImageRadioButton", + ], + OFFSET_OPTION_ID = 0; WITH_IMAGES = []; </script>
\ No newline at end of file diff --git a/webapp/js_tests/spec/DynamicStructureSpec.js b/webapp/js_tests/spec/DynamicStructureSpec.js index dc5af32..d52ba13 100644 --- a/webapp/js_tests/spec/DynamicStructureSpec.js +++ b/webapp/js_tests/spec/DynamicStructureSpec.js @@ -174,14 +174,6 @@ describe("", function() { }).responseText; $("#jasmine-fixtures").append(field_mustache_template); - var option_mustache_template = $.ajax({ - type: "GET", - url: '/jasmine/mustache_templates/option.html', - cache: false, - async: false - }).responseText; - $("#jasmine-fixtures").append(option_mustache_template); - Mustache.tags = ['[[', ']]']; // Preparing mustache TEMPLATES @@ -209,6 +201,19 @@ describe("", function() { it("Second option must has greater order than firt option", function() { + // Preparing mustache TEMPLATES + var option_mustache_template = $.ajax({ + type: "GET", + url: '/jasmine/mustache_templates/option.html', + cache: false, + async: false + }).responseText; + $("#jasmine-fixtures").append(option_mustache_template); + + $('script[type="text/x-mustache-template"]').each(function(i, obj){ + TEMPLATES[$(obj).attr('name')] = $(obj).text(); + }); + factoryField("0", {"container": container, "widget_type": "MultipleCheckBox"}); var field_widget = container.children(); @@ -230,7 +235,7 @@ describe("", function() { }); - describe("Options", function() { + describe("Options except TextInput and image widget types", function() { beforeEach(function() { |