minimal sanity test of export, placeholders for deeper testing
authorGil Moskowitz <gmoskowitz@xtuple.com>
Wed, 11 Jun 2014 18:47:28 +0000 (14:47 -0400)
committerGil Moskowitz <gmoskowitz@xtuple.com>
Wed, 11 Jun 2014 18:47:28 +0000 (14:47 -0400)
lib/enyo-x/source/views/grid_box.js
test/extensions/all/grid_box.js

index de85aa9..94be832 100644 (file)
@@ -351,8 +351,8 @@ trailing:true, white:true, strict: false*/
         name: "navigationButtonPanel",
         classes: "xv-buttons",
         components: [
-          {kind: "onyx.Button", name: "newButton", onclick: "newItem", classes: "icon-plus"},
-          {kind: "font.TextIcon", name: "exportButton", onclick: "exportAttr", icon: "share", content: "_export".loc()} // TODO: classes?
+          {kind: "onyx.Button", name: "newButton", ontap: "newItem", classes: "icon-plus"},
+          {kind: "font.TextIcon", name: "exportButton", ontap: "exportAttr", icon: "share", content: "_export".loc()} // TODO: classes?
         ]
       });
 
index 00288a4..804009b 100644 (file)
@@ -31,8 +31,8 @@
         _.each(XV, function (value, key) {
           var list,
             kinds = ['SalesOrderList', 'QuoteList', 'InvoiceList', 'ReturnList', 'ProjectList'];
-          // loop through lists with grid boxes
-          if (XV.inheritsFrom(value.prototype, "XV.List") && _.contains(kinds, key)) {
+          // lists with grid boxes; TODO: find candidates automatically
+          if (_.contains(kinds, key)) {
 
             describe('Create Workspace for XV.' + key, function () {
               it('Create a Workspace', function () {
@@ -40,7 +40,7 @@
                 smoke.navigateToNewWorkspace(XT.app, list, function (workspaceContainer) {
                   var workspace = workspaceContainer.$.workspace;
                   _.each(workspace.$, function (component) {
-                    if (XV.inheritsFrom(component, 'XV.GridBox') && XV.inheritsFrom(component, 'XV.WorkflowGridBox')) {
+                    if (XV.inheritsFrom(component, 'XV.GridBox')) {
 
                       describe('Test creating line items for ' + component, function () {
                         it('Create line items', function () {
                           // verify again that a row has been added
                           assert.equal(gridBox.liveModels().length, startingRows += 1);
                         });
+
+                        it('Check export', function() {
+                          function getExportButton(obj) {
+                            var result = null;
+                            if ("$" in obj) {
+                              result = obj.$.exportButton
+                                    || _.find(obj.$, getExportButton);
+                            }
+                            return result;
+                          }
+
+                          var gridBox = component
+                            , exportButton = getExportButton(gridBox);
+                          assert.ok(exportButton);
+                          // TODO: need to populate before we can export
+                          // assert.doesNotThrow(exportButton.doTap());
+                          // TODO: find the generated file & check contents
+                        });
                       });
                     }
                   });