From: Gil Moskowitz Date: Wed, 11 Jun 2014 18:47:28 +0000 (-0400) Subject: minimal sanity test of export, placeholders for deeper testing X-Git-Tag: v4.5.0-r1590-3~1^2~9^2~2 X-Git-Url: http://git.roojs.org/?a=commitdiff_plain;h=433d5e0ed79234d6b3ce05fffd855c27be1a8dbf;p=xtuple minimal sanity test of export, placeholders for deeper testing --- diff --git a/lib/enyo-x/source/views/grid_box.js b/lib/enyo-x/source/views/grid_box.js index de85aa9f3..94be8321b 100644 --- a/lib/enyo-x/source/views/grid_box.js +++ b/lib/enyo-x/source/views/grid_box.js @@ -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? ] }); diff --git a/test/extensions/all/grid_box.js b/test/extensions/all/grid_box.js index 00288a419..804009bb9 100644 --- a/test/extensions/all/grid_box.js +++ b/test/extensions/all/grid_box.js @@ -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 () { @@ -57,6 +57,24 @@ // 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 + }); }); } });