diff options
Diffstat (limited to 'vaadin-grid/test/common.js')
-rw-r--r-- | vaadin-grid/test/common.js | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/vaadin-grid/test/common.js b/vaadin-grid/test/common.js deleted file mode 100644 index 4815d96..0000000 --- a/vaadin-grid/test/common.js +++ /dev/null @@ -1,86 +0,0 @@ -var grid, wrapper; - -describe.feature = function(description, suite) { - describe(description, function() { - before(function(done) { - initializeGrid(); - - waitUntil(function() { - return grid.then; - }, done, done); - }); - - after(function() { - return grid; //make sure everything is finished before moving on. - }); - - suite(); - }); -}; - -function gridContainsText(_grid, text) { - return Polymer.dom(_grid.root).querySelector(".v-grid-tablewrapper").parentElement.innerHTML.indexOf(text) > -1; -} - -function waitUntil(check, exec, onTimeout) { - var id = setInterval(function() { - if (check()) { - clearInterval(id); - clearTimeout(timeoutId); - exec(); - } - }, 100); - - var timeoutId = setTimeout(function() { - clearInterval(id); - assert.fail(); - onTimeout(); - }, 5000); -} - - -function initializeGrid() { - wrapper = document.getElementById("gridwrapper"); - wrapper.innerHTML = "<v-grid>" + - " <table>" + - " <col header-text='Name'>" + - " <col header-text='Value'>" + - " <tbody>" + - " <tr>" + - " <td>Grid</td>" + - " <td>10000</td>" + - " </tr>" + - " <tr>" + - " <td>VaadinX</td>" + - " <td>1000</td>" + - " </tr>" + - " </tbody>" + - " <tfoot>" + - " <tr>" + - " <td>Name</td>" + - " <td>Value</td>" + - " </tr>" + - " </tfoot>"+ - " </table>" + - " </v-grid>"; - grid = wrapper.querySelector("v-grid"); - - return grid; -}; - -var local = function() { - return Polymer.dom(grid.root); -}; -var light = function() { - return Polymer.dom(grid); -}; - -var qLocal = function(selector) { - return local().querySelector(selector); -}; -var qaLocal = function(selector) { - return local().querySelectorAll(selector); -}; -var qLight = function(selector) { - return light().querySelector(selector); -}; |