Browse Source

Fix model selection not trimming filenames. Add more debugging info.

Bentley James Oakes 6 years ago
parent
commit
5a9b1f00b4
3 changed files with 7 additions and 6 deletions
  1. 1 1
      client/client.js
  2. 1 1
      client/file_browser.js
  3. 5 4
      tests/model_building_utils.js

+ 1 - 1
client/client.js

@@ -317,7 +317,7 @@ function _saveModel(fname,backup,autosave)
 	} else if( ! __isModel(fname) )	{
 		WindowManagement.openDialog(
 			_ERROR,
-			'invalid extension... models must be saved as "*.model" files');
+			'invalid extension on \'' + fname +'\' - models must be saved as "*.model" files');
 		return;
 	}
 

+ 1 - 1
client/file_browser.js

@@ -414,7 +414,7 @@ class FileBrowser{
                 return currfolder;
             },
             'getselection': function () {
-                return input.val();
+                return input.val().trim();
             },
             'clearselection': function () {
                 clearSelection();

+ 5 - 4
tests/model_building_utils.js

@@ -215,15 +215,16 @@ function save_model(client, folder_name, model_name) {
                 client.click(new_file_text)
                     .clearValue(new_file_text)
                     .setValue(new_file_text, model_name);
+
+                client.assert.ok(true, "Saving model with name: '" + model_name + "'");
             } else {
                 client.click(model_selector);
             }
 
-            client.waitForElementPresent(model_selector, 2000, "Model present: " + model_selector)
-                .waitForElementPresent("#dialog_btn", 2000, "Looking for close")
-                .pause(500)
+            client.waitForElementPresent("#dialog_btn", 2000, "Looking for close")
+                .pause(200)
                 .click("#dialog_btn")
-                .pause(500)
+                .pause(200)
                 .waitForElementNotPresent("#dialog_btn", 2000, "Save menu closes");
         }
     );