Bri Prebilic Cole | 093739a | 2015-01-23 10:22:50 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
Bri Prebilic Cole | 093739a | 2015-01-23 10:22:50 -0800 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | /* |
| 18 | ONOS GUI -- Widget -- Table Service - Unit Tests |
| 19 | */ |
Matteo Scandolo | 812aa5a | 2016-04-19 18:12:45 -0700 | [diff] [blame] | 20 | |
Matteo Scandolo | 209c6c6 | 2016-05-21 10:08:57 -0700 | [diff] [blame] | 21 | describe('factory: fw/widget/table.js', function () { |
Bri Prebilic Cole | e1bda3f | 2015-02-13 17:01:49 -0800 | [diff] [blame] | 22 | var $log, $compile, $rootScope, |
Bri Prebilic Cole | 3d4d01c | 2015-04-30 13:48:36 -0700 | [diff] [blame] | 23 | fs, ts, mast, is, |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 24 | scope, |
| 25 | containerDiv, |
| 26 | headerDiv, bodyDiv, |
| 27 | header, body, |
| 28 | mockHeader, |
| 29 | mockHeaderHeight = 40; |
Bri Prebilic Cole | aa8d2ed | 2015-01-23 16:53:29 -0800 | [diff] [blame] | 30 | |
Bri Prebilic Cole | 4162f01 | 2015-04-16 11:36:54 -0700 | [diff] [blame] | 31 | var onosFixedHeaderTags = |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 32 | '<div class="summary-list" onos-fixed-header>' + |
| 33 | '<div class="table-header">' + |
| 34 | '<table>' + |
| 35 | '<tr>' + |
| 36 | '<td colId="type" class="table-icon"></td>' + |
| 37 | '<td colId="id">Host ID </td>' + |
| 38 | '<td colId="mac" sortable>MAC Address </td>' + |
| 39 | '<td colId="location" col-width="110px">Location </td>' + |
| 40 | '</tr>' + |
| 41 | '</table>' + |
| 42 | '</div>' + |
| 43 | |
| 44 | '<div class="table-body">' + |
| 45 | '<table>' + |
| 46 | '<tr class="ignore-width">' + |
| 47 | '<td class="not-picked"></td>' + |
| 48 | '</tr>' + |
| 49 | '<tr>' + |
| 50 | '<td class="table-icon">Some Icon</td>' + |
| 51 | '<td>Some ID</td>' + |
| 52 | '<td>Some MAC Address</td>' + |
| 53 | '<td>Some Location</td>' + |
| 54 | '</tr>' + |
| 55 | '</table>' + |
| 56 | '</div>' + |
| 57 | '</div>', |
Bri Prebilic Cole | 093739a | 2015-01-23 10:22:50 -0800 | [diff] [blame] | 58 | |
Bri Prebilic Cole | 4162f01 | 2015-04-16 11:36:54 -0700 | [diff] [blame] | 59 | onosSortableHeaderTags = |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 60 | '<div onos-sortable-header ' + |
Bri Prebilic Cole | 4162f01 | 2015-04-16 11:36:54 -0700 | [diff] [blame] | 61 | 'sort-callback="sortCallback(requestParams)">' + |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 62 | '<table>' + |
| 63 | '<tr>' + |
| 64 | '<td colId="type"></td>' + |
| 65 | '<td colId="id" sortable>Host ID </td>' + |
| 66 | '<td colId="mac" sortable>MAC Address </td>' + |
| 67 | '<td colId="location" sortable>Location </td>' + |
| 68 | '</tr>' + |
| 69 | '</table>' + |
| 70 | '</div>'; |
Bri Prebilic Cole | 093739a | 2015-01-23 10:22:50 -0800 | [diff] [blame] | 71 | |
Matteo Scandolo | 209c6c6 | 2016-05-21 10:08:57 -0700 | [diff] [blame] | 72 | beforeEach(module('onosWidget', 'onosUtil', 'onosMast', 'onosSvg', 'onosRemote', 'onosLayer')); |
Bri Prebilic Cole | e1bda3f | 2015-02-13 17:01:49 -0800 | [diff] [blame] | 73 | |
Simon Hunt | 31bb01f | 2015-03-31 16:50:41 -0700 | [diff] [blame] | 74 | var mockWindow = { |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 75 | innerWidth: 600, |
| 76 | innerHeight: 400, |
Simon Hunt | 31bb01f | 2015-03-31 16:50:41 -0700 | [diff] [blame] | 77 | navigator: { |
| 78 | userAgent: 'defaultUA' |
| 79 | }, |
| 80 | on: function () {}, |
| 81 | addEventListener: function () {} |
| 82 | }; |
| 83 | |
| 84 | beforeEach(function () { |
| 85 | module(function ($provide) { |
| 86 | $provide.value('$window', mockWindow); |
| 87 | }); |
| 88 | }); |
| 89 | |
Bri Prebilic Cole | e1bda3f | 2015-02-13 17:01:49 -0800 | [diff] [blame] | 90 | beforeEach(inject(function (_$log_, _$compile_, _$rootScope_, |
Matteo Scandolo | 209c6c6 | 2016-05-21 10:08:57 -0700 | [diff] [blame] | 91 | FnService, TableBuilderService, MastService, IconService) { |
Bri Prebilic Cole | 093739a | 2015-01-23 10:22:50 -0800 | [diff] [blame] | 92 | $log = _$log_; |
Bri Prebilic Cole | e1bda3f | 2015-02-13 17:01:49 -0800 | [diff] [blame] | 93 | $compile = _$compile_; |
| 94 | $rootScope = _$rootScope_; |
| 95 | fs = FnService; |
Matteo Scandolo | 209c6c6 | 2016-05-21 10:08:57 -0700 | [diff] [blame] | 96 | ts = TableBuilderService; |
Bri Prebilic Cole | b5f2b15 | 2015-04-07 14:58:09 -0700 | [diff] [blame] | 97 | mast = MastService; |
Bri Prebilic Cole | e1bda3f | 2015-02-13 17:01:49 -0800 | [diff] [blame] | 98 | is = IconService; |
Bri Prebilic Cole | 7c44575 | 2015-02-17 14:49:46 -0800 | [diff] [blame] | 99 | scope = $rootScope.$new(); |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 100 | scope.tableData = []; |
Matteo Scandolo | 209c6c6 | 2016-05-21 10:08:57 -0700 | [diff] [blame] | 101 | })); |
Bri Prebilic Cole | e1bda3f | 2015-02-13 17:01:49 -0800 | [diff] [blame] | 102 | |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 103 | // Note: dummy header so that d3 doesn't trip up. |
| 104 | // $compile has to be used on the directive tag element, so it can't |
| 105 | // be included in the tag strings declared above. |
Bri Prebilic Cole | b5f2b15 | 2015-04-07 14:58:09 -0700 | [diff] [blame] | 106 | beforeEach(function () { |
| 107 | mockHeader = d3.select('body') |
| 108 | .append('h2') |
Bri Prebilic Cole | 4162f01 | 2015-04-16 11:36:54 -0700 | [diff] [blame] | 109 | .classed('tabular-header', true) |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 110 | .style({ |
| 111 | height: mockHeaderHeight + 'px', |
| 112 | margin: 0, |
| 113 | padding: 0 |
| 114 | }) |
| 115 | .text('Some Header'); |
Bri Prebilic Cole | b5f2b15 | 2015-04-07 14:58:09 -0700 | [diff] [blame] | 116 | }); |
| 117 | |
Simon Hunt | c4ae830 | 2015-01-26 14:22:48 -0800 | [diff] [blame] | 118 | afterEach(function () { |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 119 | containerDiv = undefined; |
| 120 | headerDiv = undefined; |
| 121 | bodyDiv = undefined; |
| 122 | header = undefined; |
| 123 | body = undefined; |
Bri Prebilic Cole | b5f2b15 | 2015-04-07 14:58:09 -0700 | [diff] [blame] | 124 | mockHeader.remove(); |
Simon Hunt | c4ae830 | 2015-01-26 14:22:48 -0800 | [diff] [blame] | 125 | }); |
| 126 | |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 127 | function populateTableData() { |
| 128 | scope.tableData = [ |
| 129 | { |
| 130 | type: 'endstation', |
| 131 | id: '1234', |
| 132 | mac: '00:00:03', |
| 133 | location: 'USA' |
| 134 | } |
| 135 | ]; |
| 136 | } |
| 137 | |
Bri Prebilic Cole | 3d4d01c | 2015-04-30 13:48:36 -0700 | [diff] [blame] | 138 | it('should define TableBuilderService', function () { |
| 139 | expect(ts).toBeDefined(); |
| 140 | }); |
| 141 | |
| 142 | it('should define api functions', function () { |
| 143 | expect(fs.areFunctions(ts, [ |
Matteo Scandolo | 209c6c6 | 2016-05-21 10:08:57 -0700 | [diff] [blame] | 144 | 'buildTable' |
Bri Prebilic Cole | 3d4d01c | 2015-04-30 13:48:36 -0700 | [diff] [blame] | 145 | ])).toBeTruthy(); |
| 146 | }); |
| 147 | |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 148 | function compile(elem) { |
| 149 | var compiled = $compile(elem); |
Bri Prebilic Cole | 7c44575 | 2015-02-17 14:49:46 -0800 | [diff] [blame] | 150 | compiled(scope); |
| 151 | scope.$digest(); |
| 152 | } |
Bri Prebilic Cole | e1bda3f | 2015-02-13 17:01:49 -0800 | [diff] [blame] | 153 | |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 154 | function selectTables() { |
| 155 | expect(containerDiv.find('div').length).toBe(2); |
Bri Prebilic Cole | e1bda3f | 2015-02-13 17:01:49 -0800 | [diff] [blame] | 156 | |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 157 | headerDiv = angular.element(containerDiv[0].querySelector('.table-header')); |
| 158 | expect(headerDiv.length).toBe(1); |
| 159 | |
| 160 | bodyDiv = angular.element(containerDiv[0].querySelector('.table-body')); |
| 161 | expect(bodyDiv.length).toBe(1); |
| 162 | |
| 163 | header = headerDiv.find('table'); |
| 164 | expect(header.length).toBe(1); |
| 165 | |
| 166 | body = bodyDiv.find('table'); |
| 167 | expect(body.length).toBe(1); |
Bri Prebilic Cole | 7c44575 | 2015-02-17 14:49:46 -0800 | [diff] [blame] | 168 | } |
| 169 | |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 170 | function verifyGivenTags(dirName, div) { |
| 171 | expect(div).toBeDefined(); |
| 172 | expect(div.attr(dirName)).toBe(''); |
| 173 | } |
Bri Prebilic Cole | 7c44575 | 2015-02-17 14:49:46 -0800 | [diff] [blame] | 174 | |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 175 | function verifyDefaultSize() { |
| 176 | expect(header.css('width')).toBe('570px'); |
| 177 | expect(body.css('width')).toBe('570px'); |
| 178 | } |
Bri Prebilic Cole | 4162f01 | 2015-04-16 11:36:54 -0700 | [diff] [blame] | 179 | |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 180 | function verifyHeight() { |
Bri Prebilic Cole | 9a5e006 | 2015-05-11 17:20:57 -0700 | [diff] [blame] | 181 | var padding = 22, |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 182 | mastHeight = 36, |
| 183 | tableHeight = (mockWindow.innerHeight - mockHeaderHeight) - |
| 184 | (fs.noPx(headerDiv.css('height')) + mastHeight + padding); |
| 185 | |
| 186 | expect(bodyDiv.css('height')).toBe(tableHeight + 'px'); |
Bri Prebilic Cole | 7c44575 | 2015-02-17 14:49:46 -0800 | [diff] [blame] | 187 | } |
| 188 | |
| 189 | function verifyColWidth() { |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 190 | var hdrs = header.find('td'), |
| 191 | cols = body.find('td'); |
Bri Prebilic Cole | 7c44575 | 2015-02-17 14:49:46 -0800 | [diff] [blame] | 192 | |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 193 | expect(angular.element(hdrs[0]).css('width')).toBe('33px'); |
| 194 | expect(angular.element(hdrs[3]).css('width')).toBe('110px'); |
Bri Prebilic Cole | 7c44575 | 2015-02-17 14:49:46 -0800 | [diff] [blame] | 195 | |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 196 | expect(angular.element(cols[1]).css('width')).toBe('33px'); |
| 197 | expect(angular.element(cols[4]).css('width')).toBe('110px'); |
| 198 | } |
Bri Prebilic Cole | 7c44575 | 2015-02-17 14:49:46 -0800 | [diff] [blame] | 199 | |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 200 | function verifyCallbacks(h) { |
| 201 | expect(scope.sortCallback).not.toHaveBeenCalled(); |
Bri Prebilic Cole | 7c44575 | 2015-02-17 14:49:46 -0800 | [diff] [blame] | 202 | |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 203 | h[0].click(); |
| 204 | expect(scope.sortCallback).not.toHaveBeenCalled(); |
| 205 | |
| 206 | h[1].click(); |
| 207 | expect(scope.sortCallback).toHaveBeenCalledWith({ |
| 208 | sortCol: 'id', |
| 209 | sortDir: 'asc' |
| 210 | }); |
| 211 | h[1].click(); |
| 212 | expect(scope.sortCallback).toHaveBeenCalledWith({ |
| 213 | sortCol: 'id', |
| 214 | sortDir: 'desc' |
| 215 | }); |
| 216 | h[1].click(); |
| 217 | expect(scope.sortCallback).toHaveBeenCalledWith({ |
| 218 | sortCol: 'id', |
| 219 | sortDir: 'asc' |
| 220 | }); |
| 221 | |
| 222 | h[2].click(); |
| 223 | expect(scope.sortCallback).toHaveBeenCalledWith({ |
| 224 | sortCol: 'mac', |
| 225 | sortDir: 'asc' |
| 226 | }); |
| 227 | h[2].click(); |
| 228 | expect(scope.sortCallback).toHaveBeenCalledWith({ |
| 229 | sortCol: 'mac', |
| 230 | sortDir: 'desc' |
| 231 | }); |
| 232 | h[2].click(); |
| 233 | expect(scope.sortCallback).toHaveBeenCalledWith({ |
| 234 | sortCol: 'mac', |
| 235 | sortDir: 'asc' |
| 236 | }); |
| 237 | |
| 238 | h[3].click(); |
| 239 | expect(scope.sortCallback).toHaveBeenCalledWith({ |
| 240 | sortCol: 'location', |
| 241 | sortDir: 'asc' |
| 242 | }); |
| 243 | h[3].click(); |
| 244 | expect(scope.sortCallback).toHaveBeenCalledWith({ |
| 245 | sortCol: 'location', |
| 246 | sortDir: 'desc' |
| 247 | }); |
| 248 | h[3].click(); |
| 249 | expect(scope.sortCallback).toHaveBeenCalledWith({ |
| 250 | sortCol: 'location', |
| 251 | sortDir: 'asc' |
Bri Prebilic Cole | 7c44575 | 2015-02-17 14:49:46 -0800 | [diff] [blame] | 252 | }); |
| 253 | } |
| 254 | |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 255 | function verifyIcons(h) { |
| 256 | var currH, div; |
Bri Prebilic Cole | 7c44575 | 2015-02-17 14:49:46 -0800 | [diff] [blame] | 257 | |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 258 | h[1].click(); |
| 259 | currH = angular.element(h[1]); |
| 260 | div = currH.find('div'); |
Bri Prebilic Cole | 3d4d01c | 2015-04-30 13:48:36 -0700 | [diff] [blame] | 261 | expect(div.html()).toBe( |
| 262 | '<svg class="embeddedIcon" width="10" height="10" viewBox="0 0 ' + |
| 263 | '50 50"><g class="icon upArrow"><rect width="50" height="50" ' + |
| 264 | 'rx="5"></rect><use width="50" height="50" class="glyph" xmlns:' + |
| 265 | 'xlink="http://www.w3.org/1999/xlink" xlink:href="#triangleUp">' + |
| 266 | '</use></g></svg>' |
| 267 | ); |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 268 | h[1].click(); |
| 269 | div = currH.find('div'); |
Bri Prebilic Cole | 3d4d01c | 2015-04-30 13:48:36 -0700 | [diff] [blame] | 270 | expect(div.html()).toBe( |
| 271 | '<svg class="embeddedIcon" width="10" height="10" viewBox="0 0 ' + |
| 272 | '50 50"><g class="icon downArrow"><rect width="50" height="50" ' + |
| 273 | 'rx="5"></rect><use width="50" height="50" class="glyph" xmlns:' + |
| 274 | 'xlink="http://www.w3.org/1999/xlink" xlink:href="#triangleDown">' + |
| 275 | '</use></g></svg>' |
| 276 | ); |
Bri Prebilic Cole | 7c44575 | 2015-02-17 14:49:46 -0800 | [diff] [blame] | 277 | |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 278 | h[2].click(); |
| 279 | div = currH.children(); |
Bri Prebilic Cole | 7c44575 | 2015-02-17 14:49:46 -0800 | [diff] [blame] | 280 | // clicked on a new element, so the previous icon should have been deleted |
| 281 | expect(div.html()).toBeFalsy(); |
| 282 | |
| 283 | // the new element should have the ascending icon |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 284 | currH = angular.element(h[2]); |
| 285 | div = currH.children(); |
Bri Prebilic Cole | 3d4d01c | 2015-04-30 13:48:36 -0700 | [diff] [blame] | 286 | expect(div.html()).toBe( |
| 287 | '<svg class="embeddedIcon" width="10" height="10" viewBox="0 0 ' + |
| 288 | '50 50"><g class="icon upArrow"><rect width="50" height="50" ' + |
| 289 | 'rx="5"></rect><use width="50" height="50" class="glyph" xmlns:' + |
| 290 | 'xlink="http://www.w3.org/1999/xlink" xlink:href="#triangleUp">' + |
| 291 | '</use></g></svg>' |
| 292 | ); |
Bri Prebilic Cole | 7c44575 | 2015-02-17 14:49:46 -0800 | [diff] [blame] | 293 | } |
| 294 | |
Matteo Scandolo | 209c6c6 | 2016-05-21 10:08:57 -0700 | [diff] [blame] | 295 | xit('should affirm that onos-fixed-header is working', function () { |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 296 | containerDiv = angular.element(onosFixedHeaderTags); |
Bri Prebilic Cole | 7c44575 | 2015-02-17 14:49:46 -0800 | [diff] [blame] | 297 | |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 298 | compile(containerDiv); |
Bri Prebilic Cole | 7c44575 | 2015-02-17 14:49:46 -0800 | [diff] [blame] | 299 | |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 300 | verifyGivenTags('onos-fixed-header', containerDiv); |
| 301 | selectTables(); |
| 302 | verifyDefaultSize(); |
| 303 | |
| 304 | populateTableData(); |
| 305 | |
Bri Prebilic Cole | 7c44575 | 2015-02-17 14:49:46 -0800 | [diff] [blame] | 306 | scope.$emit('LastElement'); |
| 307 | scope.$digest(); |
| 308 | |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 309 | verifyHeight(); |
| 310 | verifyColWidth(); |
| 311 | |
| 312 | mockWindow.innerHeight = 300; |
| 313 | scope.$digest(); |
| 314 | verifyHeight(); |
| 315 | |
| 316 | mockWindow.innerWidth = 500; |
| 317 | scope.$digest(); |
Bri Prebilic Cole | 7c44575 | 2015-02-17 14:49:46 -0800 | [diff] [blame] | 318 | verifyColWidth(); |
Bri Prebilic Cole | 093739a | 2015-01-23 10:22:50 -0800 | [diff] [blame] | 319 | }); |
Bri Prebilic Cole | aa8d2ed | 2015-01-23 16:53:29 -0800 | [diff] [blame] | 320 | |
Matteo Scandolo | 209c6c6 | 2016-05-21 10:08:57 -0700 | [diff] [blame] | 321 | xit('should affirm that onos-sortable-header is working', function () { |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 322 | headerDiv = angular.element(onosSortableHeaderTags); |
Bri Prebilic Cole | aa8d2ed | 2015-01-23 16:53:29 -0800 | [diff] [blame] | 323 | |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 324 | compile(headerDiv); |
| 325 | verifyGivenTags('onos-sortable-header', headerDiv); |
Bri Prebilic Cole | 3d4d01c | 2015-04-30 13:48:36 -0700 | [diff] [blame] | 326 | |
Bri Prebilic Cole | 7c44575 | 2015-02-17 14:49:46 -0800 | [diff] [blame] | 327 | scope.sortCallback = jasmine.createSpy('sortCallback'); |
| 328 | |
Bri Prebilic Cole | e568ead | 2015-05-01 09:51:28 -0700 | [diff] [blame] | 329 | header = headerDiv.find('td'); |
| 330 | verifyCallbacks(header); |
| 331 | verifyIcons(header); |
Bri Prebilic Cole | aa8d2ed | 2015-01-23 16:53:29 -0800 | [diff] [blame] | 332 | }); |
| 333 | |
Bri Prebilic Cole | 3d4d01c | 2015-04-30 13:48:36 -0700 | [diff] [blame] | 334 | // Note: testing resetSortIcons isn't feasible because due to the nature of |
| 335 | // directive compilation: they are jQuery elements, not d3 elements, |
| 336 | // so the function doesn't work. |
| 337 | |
Bri Prebilic Cole | aa8d2ed | 2015-01-23 16:53:29 -0800 | [diff] [blame] | 338 | }); |