Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 1 | // Regarding async: |
| 2 | // http://stackoverflow.com/questions/16423156/getting-requirejs-to-work-with-jasmine |
| 3 | |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 4 | var available = [ |
| 5 | 'base/s=spans', |
| 6 | 'corenlp/c=spans', |
| 7 | 'corenlp/ne=tokens', |
| 8 | 'corenlp/p=tokens', |
| 9 | 'corenlp/s=spans', |
| 10 | 'glemm/l=tokens', |
| 11 | 'mate/l=tokens', |
| 12 | 'mate/m=tokens', |
| 13 | 'mate/p=tokens', |
| 14 | 'opennlp/p=tokens', |
| 15 | 'opennlp/s=spans', |
| 16 | 'tt/l=tokens', |
| 17 | 'tt/p=tokens', |
| 18 | 'tt/s=spans' |
| 19 | ]; |
| 20 | |
| 21 | var match = { |
| 22 | 'corpusID' : 'WPD', |
| 23 | 'docID' : 'UUU', |
| 24 | 'textID' : '01912', |
| 25 | 'matchID' : 'p121-122', |
Akron | 0a6768f | 2016-07-13 18:00:43 +0200 | [diff] [blame] | 26 | 'textSigle' : 'WPD/UUU/01912', |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 27 | 'available' : available |
| 28 | }; |
| 29 | |
| 30 | var snippet = "<span title=\"cnx/l:meist\">" + |
Akron | 4e47d0b | 2017-07-03 17:58:37 +0200 | [diff] [blame] | 31 | " <span title=\"cnx/p:ADV\">" + |
| 32 | " <span title=\"cnx/syn:@PREMOD\">" + |
| 33 | " <span title=\"mate/l:meist\">" + |
| 34 | " <span title=\"mate/l:meist\">" + |
| 35 | " <span title=\"mate/p:ADV\">" + |
| 36 | " <span title=\"opennlp/p:ADV\">meist</span>" + |
| 37 | " </span>" + |
| 38 | " </span>" + |
| 39 | " </span>" + |
| 40 | " </span>" + |
| 41 | " </span>" + |
| 42 | "</span>" + |
| 43 | "<span title=\"cnx/l:deutlich\">" + |
| 44 | " <span title=\"cnx/p:A\">" + |
| 45 | " <span title=\"cnx/syn:@PREMOD\">" + |
| 46 | " <span title=\"mate/l:deutlich\">" + |
| 47 | " <span title=\"mate/m:degree:pos\">" + |
| 48 | " <span title=\"mate/p:ADJD\">" + |
| 49 | " <span title=\"opennlp/p:ADJD\">deutlich</span>" + |
| 50 | " </span>" + |
| 51 | " </span>" + |
| 52 | " </span>" + |
| 53 | " </span>" + |
| 54 | " </span>" + |
| 55 | "</span>" + |
| 56 | "<span title=\"cnx/l:fähig\">" + |
| 57 | " <span title=\"cnx/l:leistung\">" + |
| 58 | " <span title=\"cnx/p:A\">" + |
| 59 | " <span title=\"cnx/p:ADJA\">" + |
| 60 | " <span title=\"cnx/syn:@NH\">" + |
| 61 | " <span title=\"mate/l:leistungsfähig\">" + |
| 62 | " <span title=\"mate/m:degree:comp\">" + |
| 63 | " <span title=\"mate/p:ADJD\">" + |
| 64 | " <span title=\"opennlp/p:ADJD\">leistungsfähiger</span>" + |
| 65 | " </span>" + |
| 66 | " </span>" + |
| 67 | " </span>" + |
| 68 | " </span>" + |
| 69 | " </span>" + |
| 70 | " </span>" + |
| 71 | " </span>" + |
| 72 | "</span>"; |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 73 | |
| 74 | var treeSnippet = |
| 75 | "<span class=\"context-left\"></span>" + |
| 76 | "<span class=\"match\">" + |
| 77 | " <span title=\"xip/c:MC\">" + |
| 78 | " <span title=\"xip/c:TOP\">" + |
| 79 | " <span title=\"xip/c:PP\">" + |
| 80 | " <span title=\"xip/c:PREP\">Mit</span>" + |
| 81 | " <span title=\"xip/c:NP\">" + |
| 82 | " <span title=\"xip/c:DET\">dieser</span>" + |
| 83 | " <span title=\"xip/c:NPA\">" + |
| 84 | " <span title=\"xip/c:NOUN\">Methode</span>" + |
| 85 | " </span>" + |
| 86 | " </span>" + |
| 87 | " </span>" + |
| 88 | " <span title=\"xip/c:VERB\">ist</span>" + |
Akron | 98a933f | 2016-08-11 00:19:17 +0200 | [diff] [blame] | 89 | " <mark>" + |
| 90 | " <span title=\"xip/c:NP\">" + |
| 91 | " <span title=\"xip/c:PRON\">es</span>" + |
| 92 | " </span>" + |
| 93 | " <span title=\"xip/c:AP\">" + |
| 94 | " <span title=\"xip/c:ADV\">nun</span>" + |
| 95 | " <span title=\"xip/c:ADJ\">möglich</span>" + |
| 96 | " </span>" + |
| 97 | " </mark>" + |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 98 | " <span title=\"xip/c:ADV\">z. B.</span>" + |
| 99 | " <span title=\"xip/c:NPA\">" + |
| 100 | " <span title=\"xip/c:NP\">" + |
| 101 | " <span title=\"xip/c:NOUN\">Voice</span>" + |
| 102 | " </span>" + |
| 103 | " </span>" + "(" + |
| 104 | " <span title=\"xip/c:INS\">" + |
| 105 | " <span title=\"xip/c:NPA\">" + |
| 106 | " <span title=\"xip/c:NP\">" + |
| 107 | " <span title=\"xip/c:NOUN\">Sprache</span>" + |
| 108 | " </span>" + |
| 109 | " </span>" + |
| 110 | " </span>" + ")" + |
| 111 | " <span title=\"xip/c:VERB\">bevorzugt</span>" + |
| 112 | " <span title=\"xip/c:PP\">" + |
| 113 | " <span title=\"xip/c:PREP\">in</span>" + |
| 114 | " <span title=\"xip/c:NP\">" + |
| 115 | " <span title=\"xip/c:PRON\">der</span>" + |
| 116 | " </span>" + |
| 117 | " <span title=\"xip/c:NPA\">" + |
| 118 | " <span title=\"xip/c:NP\">" + |
| 119 | " <span title=\"xip/c:NOUN\">Bridge</span>" + |
| 120 | " </span>" + |
| 121 | " </span>" + |
| 122 | " </span>" + |
| 123 | " <span title=\"xip/c:INFC\">" + |
| 124 | " <span title=\"xip/c:INS\">" + |
| 125 | " <span title=\"xip/c:VERB\">weiterzugeben</span>" + |
| 126 | " </span>" + |
| 127 | " </span>" + |
| 128 | " </span>" + |
| 129 | " </span>" + |
| 130 | "</span>" + |
| 131 | "<span class=\"context-right\"></span>"; |
| 132 | |
| 133 | |
| 134 | function matchElementFactory () { |
| 135 | var me = document.createElement('li'); |
| 136 | |
| 137 | me.setAttribute( |
| 138 | 'data-available-info', |
| 139 | 'base/s=spans corenlp/c=spans corenlp/ne=tokens corenlp/p=tokens' + |
| 140 | ' corenlp/s=spans glemm/l=tokens mate/l=tokens mate/m=tokens' + |
| 141 | ' mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens' + |
| 142 | ' tt/p=tokens tt/s=spans'); |
| 143 | |
| 144 | me.setAttribute('data-corpus-id', 'WPD'); |
| 145 | me.setAttribute('data-doc-id', 'FFF'); |
| 146 | me.setAttribute('data-text-id', '01460'); |
Akron | 0a6768f | 2016-07-13 18:00:43 +0200 | [diff] [blame] | 147 | me.setAttribute('data-text-sigle', 'WPD/FFF/01460'); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 148 | me.setAttribute('data-match-id', 'p119-120'); |
| 149 | me.innerHTML = '<div><div class="snippet">check</div></div><p class="ref">me</p>'; |
| 150 | return me; |
| 151 | }; |
| 152 | |
Akron | cdb0baa | 2016-11-07 01:52:11 +0100 | [diff] [blame] | 153 | function matchElementReal () { |
| 154 | var me = document.createElement('em'); |
| 155 | me.innerHTML = |
| 156 | '<li data-match-id="p85183-85184"' + |
| 157 | ' data-text-sigle="GOE/AGI/00000"' + |
| 158 | ' data-available-info="base/s=spans corenlp/c=spans corenlp/p=tokens corenlp/s=spans dereko/s=spans malt/d=rels opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans"' + |
| 159 | ' data-info="{"UID":0,"author":"Goethe, Johann Wolfgang von","corpusID":null,"corpusSigle":"GOE","docID":null,"docSigle":"GOE\/AGI","layerInfos":"base\/s=spans corenlp\/c=spans corenlp\/p=tokens corenlp\/s=spans dereko\/s=spans malt\/d=rels opennlp\/p=tokens opennlp\/s=spans tt\/l=tokens tt\/p=tokens tt\/s=spans","matchID":"match-GOE\/AGI\/00000-p85183-85184","pubDate":"1982","pubPlace":"München","subTitle":"Auch ich in Arkadien!","textID":null,"textSigle":"GOE\/AGI\/00000","title":"Italienische Reise"}"' + |
| 160 | ' id="GOE/AGI/00000#p85183-85184">' + |
| 161 | '<div>' + |
| 162 | '<div class="flag"></div>' + |
| 163 | '<div class="snippet startMore endMore"><span class="context-left"><span class="more"></span>keine großen Flächen, aber sanft gegeneinander laufende Berg- und Hügelrücken, durchgängig mit Weizen und Gerste bestellt, die eine ununterbrochene Masse von Fruchtbarkeit dem Auge darbieten. der diesen Pflanzen geeignete Boden wird so genutzt und so geschont, daß man nirgends einen </span><span class="match"><mark>Baum</mark></span><span class="context-right"> sieht, ja, alle die kleinen Ortschaften und Wohnungen liegen auf Rücken der Hügel, wo eine hinstreichende Reihe Kalkfelsen den Boden ohnehin unbrauchbar macht. dort wohnen die Weiber das ganze Jahr, mit Spinnen und Weben beschäftigt, die Männer hingegen bringen zur<span class="more"></span></span></div>' + |
| 164 | '</div>' + |
| 165 | '<p class="ref"><strong>Italienische Reise</strong> von Goethe, Johann Wolfgang von (<time datetime="1982">1982</time>) <span class="sigle">[GOE/AGI/00000]</span> </p>' + |
| 166 | '</li>'; |
| 167 | return me.firstChild; |
| 168 | }; |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 169 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 170 | define(['match'], function () { |
Nils Diewald | 5814133 | 2015-04-07 16:18:45 +0000 | [diff] [blame] | 171 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 172 | // Override getMatchInfo API call |
| 173 | KorAP.API.getMatchInfo = function (x, param, cb) { |
| 174 | if (param['spans'] === undefined || param['spans'] === false) |
| 175 | cb({ "snippet": snippet }); |
| 176 | else |
| 177 | cb({ "snippet": treeSnippet }); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 178 | }; |
Akron | 671fdb9 | 2017-09-12 18:09:46 +0200 | [diff] [blame^] | 179 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 180 | describe('KorAP.InfoLayer', function () { |
| 181 | |
| 182 | var infoClass = require('match/infolayer'); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 183 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 184 | it('should be initializable', function () { |
| 185 | expect( |
Akron | 671fdb9 | 2017-09-12 18:09:46 +0200 | [diff] [blame^] | 186 | function() { infoClass.create() } |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 187 | ).toThrow(new Error("Missing parameters")); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 188 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 189 | expect( |
Akron | 671fdb9 | 2017-09-12 18:09:46 +0200 | [diff] [blame^] | 190 | function() { infoClass.create("base") } |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 191 | ).toThrow(new Error("Missing parameters")); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 192 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 193 | var layer = infoClass.create("base", "s"); |
| 194 | expect(layer).toBeTruthy(); |
| 195 | expect(layer.foundry).toEqual("base"); |
| 196 | expect(layer.layer).toEqual("s"); |
| 197 | expect(layer.type).toEqual("tokens"); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 198 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 199 | layer = infoClass.create("cnx", "syn", "spans"); |
| 200 | expect(layer).toBeTruthy(); |
| 201 | expect(layer.foundry).toEqual("cnx"); |
| 202 | expect(layer.layer).toEqual("syn"); |
| 203 | expect(layer.type).toEqual("spans"); |
Nils Diewald | 5814133 | 2015-04-07 16:18:45 +0000 | [diff] [blame] | 204 | }); |
| 205 | }); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 206 | |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 207 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 208 | describe('KorAP.Match', function () { |
| 209 | var match = { |
| 210 | 'corpusID' : 'WPD', |
| 211 | 'docID' : 'UUU', |
| 212 | 'textID' : '01912', |
| 213 | 'matchID' : 'p121-122', |
Akron | 0a6768f | 2016-07-13 18:00:43 +0200 | [diff] [blame] | 214 | 'textSigle' : 'WPD/UUU/01912', |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 215 | 'available' : available |
| 216 | }; |
| 217 | |
| 218 | var matchClass = require('match'); |
| 219 | |
| 220 | it('should be initializable by Object', function () { |
| 221 | expect(function() { |
Akron | 671fdb9 | 2017-09-12 18:09:46 +0200 | [diff] [blame^] | 222 | matchClass.create() |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 223 | }).toThrow(new Error('Missing parameters')); |
| 224 | |
| 225 | expect(matchClass.create(match)).toBeTruthy(); |
| 226 | |
| 227 | var m = matchClass.create(match); |
Akron | 0a6768f | 2016-07-13 18:00:43 +0200 | [diff] [blame] | 228 | expect(m.textSigle).toEqual("WPD/UUU/01912"); |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 229 | expect(m.matchID).toEqual("p121-122"); |
| 230 | |
| 231 | // /corpus/WPD/UUU.01912/p121-122/matchInfo?spans=false&foundry=* |
| 232 | var m = matchClass.create(match); |
| 233 | |
| 234 | // Spans: |
| 235 | var spans = m.getSpans(); |
| 236 | expect(spans[0].foundry).toEqual("base"); |
| 237 | expect(spans[0].layer).toEqual("s"); |
| 238 | |
| 239 | expect(spans[1].foundry).toEqual("corenlp"); |
| 240 | expect(spans[1].layer).toEqual("c"); |
| 241 | |
| 242 | expect(spans[2].foundry).toEqual("corenlp"); |
| 243 | expect(spans[2].layer).toEqual("s"); |
| 244 | |
| 245 | expect(spans[spans.length-1].foundry).toEqual("tt"); |
| 246 | expect(spans[spans.length-1].layer).toEqual("s"); |
| 247 | |
| 248 | // Tokens: |
| 249 | var tokens = m.getTokens(); |
| 250 | expect(tokens[0].foundry).toEqual("corenlp"); |
| 251 | expect(tokens[0].layer).toEqual("ne"); |
| 252 | |
| 253 | expect(tokens[1].foundry).toEqual("corenlp"); |
| 254 | expect(tokens[1].layer).toEqual("p"); |
| 255 | |
| 256 | expect(tokens[tokens.length-1].foundry).toEqual("tt"); |
| 257 | expect(tokens[tokens.length-1].layer).toEqual("p"); |
Nils Diewald | 5814133 | 2015-04-07 16:18:45 +0000 | [diff] [blame] | 258 | }); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 259 | |
| 260 | |
Akron | cdb0baa | 2016-11-07 01:52:11 +0100 | [diff] [blame] | 261 | it('should be initializable by Node 1', function () { |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 262 | var m = matchClass.create(matchElementFactory()); |
Akron | 0a6768f | 2016-07-13 18:00:43 +0200 | [diff] [blame] | 263 | expect(m.textSigle).toEqual("WPD/FFF/01460"); |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 264 | expect(m.matchID).toEqual("p119-120"); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 265 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 266 | // Spans: |
| 267 | var spans = m.getSpans(); |
| 268 | expect(spans[0].foundry).toEqual("base"); |
| 269 | expect(spans[0].layer).toEqual("s"); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 270 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 271 | expect(spans[1].foundry).toEqual("corenlp"); |
| 272 | expect(spans[1].layer).toEqual("c"); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 273 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 274 | expect(spans[2].foundry).toEqual("corenlp"); |
| 275 | expect(spans[2].layer).toEqual("s"); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 276 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 277 | expect(spans[spans.length-1].foundry).toEqual("tt"); |
| 278 | expect(spans[spans.length-1].layer).toEqual("s"); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 279 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 280 | // Tokens: |
| 281 | var tokens = m.getTokens(); |
| 282 | expect(tokens[0].foundry).toEqual("corenlp"); |
| 283 | expect(tokens[0].layer).toEqual("ne"); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 284 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 285 | expect(tokens[1].foundry).toEqual("corenlp"); |
| 286 | expect(tokens[1].layer).toEqual("p"); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 287 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 288 | expect(tokens[tokens.length-1].foundry).toEqual("tt"); |
| 289 | expect(tokens[tokens.length-1].layer).toEqual("p"); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 290 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 291 | }); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 292 | |
Akron | cdb0baa | 2016-11-07 01:52:11 +0100 | [diff] [blame] | 293 | it('should be initializable by Node 2', function () { |
| 294 | var ele = matchElementReal(); |
| 295 | var m = matchClass.create(ele); |
| 296 | expect(m.textSigle).toEqual("GOE/AGI/00000"); |
| 297 | expect(m.matchID).toEqual("p85183-85184"); |
| 298 | }); |
| 299 | |
| 300 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 301 | it('should react to gui actions', function () { |
| 302 | var e = matchElementFactory(); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 303 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 304 | expect(e.classList.contains('active')).toBe(false); |
| 305 | expect(e["_match"]).toBe(undefined); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 306 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 307 | var m = matchClass.create(e); |
| 308 | |
| 309 | expect(e.classList.contains('active')).toBe(false); |
| 310 | expect(e["_match"]).not.toBe(undefined); |
| 311 | |
| 312 | // Open the match |
| 313 | m.open(); |
| 314 | |
| 315 | expect(e.classList.contains('active')).toBe(true); |
| 316 | expect(e["_match"]).not.toBe(undefined); |
| 317 | |
| 318 | // Close the match |
| 319 | m.close(); |
| 320 | expect(e.classList.contains('active')).toBe(false); |
| 321 | expect(e["_match"]).not.toBe(undefined); |
| 322 | |
Nils Diewald | 5814133 | 2015-04-07 16:18:45 +0000 | [diff] [blame] | 323 | }); |
| 324 | }); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 325 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 326 | |
| 327 | describe('KorAP.MatchInfo', function () { |
| 328 | |
| 329 | var matchClass = require('match'); |
| 330 | |
| 331 | var m = matchClass.create(match); |
| 332 | var info = m.info(); |
| 333 | |
| 334 | it('should contain a valid info', function () { |
| 335 | expect(m._info).toEqual(info); |
| 336 | }); |
| 337 | |
| 338 | var table1, table2; |
| 339 | |
| 340 | // Async preparation |
| 341 | it('should fail to load a table async', function (done) { |
| 342 | expect(info).toBeTruthy(); |
| 343 | |
| 344 | info.getTable([], function (tablen) { |
Akron | 671fdb9 | 2017-09-12 18:09:46 +0200 | [diff] [blame^] | 345 | table1 = tablen; |
| 346 | done(); |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 347 | }); |
| 348 | }); |
| 349 | |
Akron | 671fdb9 | 2017-09-12 18:09:46 +0200 | [diff] [blame^] | 350 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 351 | it('should\'nt be parsable (async)', function () { |
| 352 | expect(table1).not.toBeTruthy(); |
| 353 | }); |
| 354 | |
Akron | 671fdb9 | 2017-09-12 18:09:46 +0200 | [diff] [blame^] | 355 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 356 | it('should load a working table async', function(done) { |
| 357 | expect(info).toBeTruthy(); |
| 358 | info.getTable(undefined, function (tablem) { |
Akron | 671fdb9 | 2017-09-12 18:09:46 +0200 | [diff] [blame^] | 359 | table2 = tablem; |
| 360 | done(); |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 361 | }); |
| 362 | }); |
| 363 | |
Akron | 671fdb9 | 2017-09-12 18:09:46 +0200 | [diff] [blame^] | 364 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 365 | it('should parse into a table (async)', function () { |
| 366 | expect(table2).toBeTruthy(); |
| 367 | |
| 368 | expect(table2.length()).toBe(3); |
| 369 | |
| 370 | expect(table2.getToken(0)).toBe("meist"); |
| 371 | expect(table2.getToken(1)).toBe("deutlich"); |
| 372 | expect(table2.getToken(2)).toBe("leistungsfähiger"); |
| 373 | |
| 374 | expect(table2.getValue(0, "cnx", "p")[0]).toBe("ADV"); |
| 375 | expect(table2.getValue(0, "cnx", "syn")[0]).toBe("@PREMOD"); |
Akron | 916ec25 | 2016-11-10 17:06:32 +0100 | [diff] [blame] | 376 | expect(table2.getValue(0, "mate", "l")[0]).toBe("meist"); |
| 377 | expect(table2.getValue(0, "mate", "l")[1]).toBeUndefined(); |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 378 | |
| 379 | expect(table2.getValue(2, "cnx", "l")[0]).toBe("fähig"); |
| 380 | expect(table2.getValue(2, "cnx", "l")[1]).toBe("leistung"); |
| 381 | }); |
| 382 | |
Akron | 671fdb9 | 2017-09-12 18:09:46 +0200 | [diff] [blame^] | 383 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 384 | it('should parse into a table view', function () { |
| 385 | var matchElement = matchElementFactory(); |
| 386 | expect(matchElement.tagName).toEqual('LI'); |
| 387 | |
| 388 | // Match |
| 389 | expect(matchElement.children[0].tagName).toEqual('DIV'); |
| 390 | |
| 391 | // snippet |
| 392 | expect(matchElement.children[0].children[0].tagName).toEqual('DIV'); |
| 393 | expect(matchElement.children[0].children[0].classList.contains('snippet')).toBeTruthy(); |
| 394 | expect(matchElement.children[0].children[0].firstChild.nodeValue).toEqual('check'); |
| 395 | |
| 396 | // reference |
| 397 | expect(matchElement.children[1].classList.contains('ref')).toBeTruthy(); |
| 398 | expect(matchElement.children[1].firstChild.nodeValue).toEqual('me'); |
| 399 | |
| 400 | // not yet |
| 401 | expect(matchElement.children[0].children[1]).toBe(undefined); |
| 402 | |
| 403 | var info = matchClass.create(matchElement).info(); |
| 404 | info.toggle(); |
| 405 | |
| 406 | // Match |
| 407 | expect(matchElement.children[0].tagName).toEqual('DIV'); |
| 408 | |
| 409 | // snippet |
| 410 | expect(matchElement.children[0].children[0].tagName).toEqual('DIV'); |
| 411 | expect(matchElement.children[0].children[0].classList.contains('snippet')).toBeTruthy(); |
| 412 | expect(matchElement.children[0].children[0].firstChild.nodeValue).toEqual('check'); |
| 413 | |
| 414 | // reference |
| 415 | expect(matchElement.children[1].classList.contains('ref')).toBeTruthy(); |
| 416 | expect(matchElement.children[1].firstChild.nodeValue).toEqual('me'); |
| 417 | |
| 418 | // now |
Akron | aa7fce5 | 2017-06-30 21:15:18 +0200 | [diff] [blame] | 419 | var infotable = matchElement.children[2]; |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 420 | expect(infotable.tagName).toEqual('DIV'); |
Akron | aa7fce5 | 2017-06-30 21:15:18 +0200 | [diff] [blame] | 421 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 422 | expect(infotable.classList.contains('matchinfo')).toBeTruthy(); |
| 423 | |
| 424 | expect(infotable.children[0].classList.contains('matchtable')).toBeTruthy(); |
| 425 | expect(infotable.children[1].classList.contains('addtree')).toBeTruthy(); |
| 426 | }); |
| 427 | |
Akron | 671fdb9 | 2017-09-12 18:09:46 +0200 | [diff] [blame^] | 428 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 429 | var tree; |
| 430 | it('should parse into a tree (async) 1', function (done) { |
| 431 | var info = matchClass.create(match).info(); |
| 432 | expect(info).toBeTruthy(); |
| 433 | info.getTree(undefined, undefined, function (treem) { |
Akron | 671fdb9 | 2017-09-12 18:09:46 +0200 | [diff] [blame^] | 434 | tree = treem; |
| 435 | done(); |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 436 | }); |
| 437 | }); |
| 438 | |
Akron | 671fdb9 | 2017-09-12 18:09:46 +0200 | [diff] [blame^] | 439 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 440 | it('should parse into a tree (async) 2', function () { |
| 441 | expect(tree).toBeTruthy(); |
| 442 | expect(tree.nodes()).toEqual(49); |
| 443 | }); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 444 | |
Akron | 671fdb9 | 2017-09-12 18:09:46 +0200 | [diff] [blame^] | 445 | |
Akron | 98a933f | 2016-08-11 00:19:17 +0200 | [diff] [blame] | 446 | var matchElement, info; |
| 447 | // var info, matchElement; |
| 448 | it('should parse into a tree view', function () { |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 449 | matchElement = matchElementFactory(); |
| 450 | expect(matchElement.tagName).toEqual('LI'); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 451 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 452 | info = matchClass.create(matchElement).info(); |
| 453 | info.toggle(); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 454 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 455 | // Match |
| 456 | expect(matchElement.children[0].tagName).toEqual('DIV'); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 457 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 458 | // snippet |
| 459 | expect(matchElement.children[0].children[0].tagName).toEqual('DIV'); |
| 460 | expect(matchElement.children[0].children[0].classList.contains('snippet')).toBeTruthy(); |
| 461 | expect(matchElement.children[0].children[0].firstChild.nodeValue).toEqual('check'); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 462 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 463 | // reference |
| 464 | expect(matchElement.children[1].classList.contains('ref')).toBeTruthy(); |
| 465 | expect(matchElement.children[1].firstChild.nodeValue).toEqual('me'); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 466 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 467 | // now |
Akron | aa7fce5 | 2017-06-30 21:15:18 +0200 | [diff] [blame] | 468 | var infotable = matchElement.children[2]; |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 469 | expect(infotable.tagName).toEqual('DIV'); |
| 470 | expect(infotable.classList.contains('matchinfo')).toBeTruthy(); |
| 471 | expect(infotable.children[0].classList.contains('matchtable')).toBeTruthy(); |
| 472 | expect(infotable.children[1].classList.contains('addtree')).toBeTruthy(); |
| 473 | }); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 474 | |
Akron | 671fdb9 | 2017-09-12 18:09:46 +0200 | [diff] [blame^] | 475 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 476 | it('should add a tree view async 1', function (done) { |
| 477 | expect(info).toBeTruthy(); |
| 478 | info.addTree('mate', 'beebop', function () { |
Akron | 671fdb9 | 2017-09-12 18:09:46 +0200 | [diff] [blame^] | 479 | done(); |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 480 | }); |
| 481 | }); |
| 482 | |
Akron | 671fdb9 | 2017-09-12 18:09:46 +0200 | [diff] [blame^] | 483 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 484 | it('should add a tree view async 2', function () { |
| 485 | // With added tree |
Akron | aa7fce5 | 2017-06-30 21:15:18 +0200 | [diff] [blame] | 486 | var infotable = matchElement.children[2]; |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 487 | expect(infotable.tagName).toEqual('DIV'); |
| 488 | expect(infotable.classList.contains('matchinfo')).toBeTruthy(); |
| 489 | expect(infotable.children[0].classList.contains('matchtable')).toBeTruthy(); |
| 490 | expect(infotable.children[1].classList.contains('addtree')).toBe(false); |
| 491 | |
| 492 | var tree = infotable.children[1]; |
| 493 | expect(tree.tagName).toEqual('DIV'); |
| 494 | expect(tree.classList.contains('matchtree')).toBeTruthy(); |
| 495 | expect(tree.children[0].tagName).toEqual('H6'); |
| 496 | expect(tree.children[0].children[0].tagName).toEqual('SPAN'); |
| 497 | expect(tree.children[0].children[0].firstChild.nodeValue).toEqual('mate'); |
| 498 | expect(tree.children[0].children[1].tagName).toEqual('SPAN'); |
| 499 | expect(tree.children[0].children[1].firstChild.nodeValue).toEqual('beebop'); |
| 500 | |
| 501 | expect(tree.children[1].tagName).toEqual('DIV'); |
Nils Diewald | 5814133 | 2015-04-07 16:18:45 +0000 | [diff] [blame] | 502 | }); |
| 503 | }); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 504 | |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 505 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 506 | describe('KorAP.MatchTable', function () { |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 507 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 508 | var matchClass = require('match'); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 509 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 510 | var table; |
| 511 | it('should be retrieved async', function (done) { |
| 512 | var info = matchClass.create(match).info(); |
| 513 | expect(info).toBeTruthy(); |
| 514 | info.getTable(undefined, function (x) { |
Akron | 671fdb9 | 2017-09-12 18:09:46 +0200 | [diff] [blame^] | 515 | table = x; |
| 516 | done(); |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 517 | }); |
| 518 | }); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 519 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 520 | it('should be rendered async', function () { |
| 521 | var e = table.element(); |
| 522 | |
| 523 | expect(e.nodeName).toBe('TABLE'); |
| 524 | expect(e.children[0].nodeName).toBe('THEAD'); |
| 525 | var tr = e.children[0].children[0]; |
| 526 | expect(tr.nodeName).toBe('TR'); |
| 527 | expect(tr.children[0].nodeName).toBe('TH'); |
Nils Diewald | 5814133 | 2015-04-07 16:18:45 +0000 | [diff] [blame] | 528 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 529 | expect(tr.children[0].firstChild.nodeValue).toBe('Foundry'); |
| 530 | expect(tr.children[1].firstChild.nodeValue).toBe('Layer'); |
| 531 | expect(tr.children[2].firstChild.nodeValue).toBe('meist'); |
| 532 | expect(tr.children[3].firstChild.nodeValue).toBe('deutlich'); |
| 533 | expect(tr.children[4].firstChild.nodeValue).toBe('leistungsfähiger'); |
| 534 | |
| 535 | // first row |
| 536 | tr = e.children[1].children[0]; |
| 537 | expect(tr.nodeName).toBe('TR'); |
| 538 | expect(tr.getAttribute('tabindex')).toEqual('0'); |
| 539 | expect(tr.children[0].nodeName).toBe('TH'); |
| 540 | expect(tr.children[0].firstChild.nodeValue).toEqual('cnx'); |
| 541 | expect(tr.children[1].firstChild.nodeValue).toEqual('l'); |
| 542 | expect(tr.children[2].firstChild.nodeValue).toEqual('meist'); |
| 543 | expect(tr.children[3].firstChild.nodeValue).toEqual('deutlich'); |
Akron | 47774c4 | 2017-07-03 20:14:55 +0200 | [diff] [blame] | 544 | expect(tr.children[4].firstChild.firstChild.nodeValue).toEqual('fähig'); |
| 545 | expect(tr.children[4].lastChild.firstChild.nodeValue).toEqual('leistung'); |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 546 | |
| 547 | // second row |
| 548 | tr = e.children[1].children[1]; |
| 549 | expect(tr.nodeName).toBe('TR'); |
| 550 | expect(tr.getAttribute('tabindex')).toEqual('0'); |
| 551 | expect(tr.children[0].nodeName).toBe('TH'); |
| 552 | expect(tr.children[0].firstChild.nodeValue).toEqual('cnx'); |
| 553 | expect(tr.children[1].firstChild.nodeValue).toEqual('p'); |
| 554 | expect(tr.children[2].firstChild.nodeValue).toEqual('ADV'); |
| 555 | expect(tr.children[3].firstChild.nodeValue).toEqual('A'); |
Akron | 47774c4 | 2017-07-03 20:14:55 +0200 | [diff] [blame] | 556 | expect(tr.children[4].firstChild.firstChild.nodeValue).toEqual('A'); |
| 557 | expect(tr.children[4].lastChild.firstChild.nodeValue).toEqual('ADJA'); |
Nils Diewald | 5814133 | 2015-04-07 16:18:45 +0000 | [diff] [blame] | 558 | }); |
| 559 | }); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 560 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 561 | describe('KorAP.MatchTree', function () { |
| 562 | var tree; |
| 563 | var matchClass = require('match'); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 564 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 565 | it('should be rendered async 1', function (done) { |
| 566 | var info = matchClass.create(match).info(); |
| 567 | expect(info).toBeTruthy(); |
| 568 | info.getTree(undefined, undefined, function (y) { |
Akron | 671fdb9 | 2017-09-12 18:09:46 +0200 | [diff] [blame^] | 569 | tree = y; |
| 570 | done(); |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 571 | }); |
| 572 | }); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 573 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 574 | it('should be rendered async 2', function () { |
| 575 | var e = tree.element(); |
| 576 | expect(e.nodeName).toEqual('svg'); |
| 577 | expect(e.getElementsByTagName('g').length).toEqual(48); |
Nils Diewald | 5814133 | 2015-04-07 16:18:45 +0000 | [diff] [blame] | 578 | }); |
| 579 | }); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 580 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 581 | |
| 582 | describe('KorAP.MatchTreeItem', function () { |
| 583 | var matchTreeItemClass = require('match/treeitem'); |
| 584 | it('should be initializable', function () { |
| 585 | var mi = matchTreeItemClass.create(['cnx/c', 'cnx', 'c']) |
| 586 | expect(mi.element().firstChild.nodeValue).toEqual('cnx/c'); |
| 587 | expect(mi.lcField()).toEqual(' cnx/c'); |
| 588 | expect(mi.foundry()).toEqual('cnx'); |
| 589 | expect(mi.layer()).toEqual('c'); |
| 590 | }); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 591 | }); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 592 | |
| 593 | |
Akron | 671fdb9 | 2017-09-12 18:09:46 +0200 | [diff] [blame^] | 594 | describe('KorAP.MatchRelation', function () { |
| 595 | var relClass = require('match/relations') |
| 596 | |
| 597 | var relExample = "<span class=\"context-left\"></span>" + |
| 598 | "<span class=\"match\">" + |
| 599 | " <span xml:id=\"token-GOE/AGA/01784-p199\">" + |
| 600 | " <span xlink:title=\"malt/d:ADV\" " + |
| 601 | " xlink:type=\"simple\" " + |
| 602 | " xlink:href=\"#token-GOE/AGA/01784-p199\">dann</span>" + |
| 603 | " </span>" + |
| 604 | " zog " + |
| 605 | " <span xlink:title=\"malt/d:SUBJ\" " + |
| 606 | " xlink:type=\"simple\" " + |
| 607 | " xlink:href=\"#token-GOE/AGA/01784-p199\">ich</span>" + |
| 608 | " <span xml:id=\"token-GOE/AGA/01784-p202\">" + |
| 609 | " <span xlink:title=\"malt/d:OBJA\" " + |
| 610 | " xlink:type=\"simple\" " + |
| 611 | " xlink:href=\"#token-GOE/AGA/01784-p199\">mich</span>" + |
| 612 | " </span>" + |
| 613 | "</span>" + |
| 614 | "<span class=\"context-right\"></span>"; |
| 615 | |
| 616 | |
| 617 | it('should be initializable', function () { |
| 618 | var tree = relClass.create(); |
| 619 | expect(tree.size()).toBe(0); |
| 620 | }); |
| 621 | |
| 622 | it('should be parse string data', function () { |
| 623 | var tree = relClass.create(relExample); |
| 624 | expect(tree.size()).toBe(4); |
| 625 | }); |
| 626 | |
| 627 | |
| 628 | }); |
| 629 | |
| 630 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 631 | describe('KorAP.MatchTreeMenu', function () { |
| 632 | var matchTreeMenu = require('match/treemenu'); |
| 633 | var matchTreeItem = require('match/treeitem'); |
| 634 | |
| 635 | it('should be initializable', function () { |
| 636 | var menu = matchTreeMenu.create(undefined, [ |
Akron | 671fdb9 | 2017-09-12 18:09:46 +0200 | [diff] [blame^] | 637 | ['cnx/c', 'cnx', 'c'], |
| 638 | ['xip/c', 'xip', 'c'] |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 639 | ]); |
| 640 | |
| 641 | expect(menu.itemClass()).toEqual(matchTreeItem); |
| 642 | expect(menu.element().nodeName).toEqual('UL'); |
Akron | aba7a5a | 2016-08-15 21:58:33 +0200 | [diff] [blame] | 643 | expect(menu.element().classList.contains('visible')).toBeFalsy(); |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 644 | expect(menu.limit()).toEqual(6); |
| 645 | menu.show(); |
Akron | aba7a5a | 2016-08-15 21:58:33 +0200 | [diff] [blame] | 646 | expect(menu.element().classList.contains('visible')).toBeTruthy(); |
Akron | c1457bf | 2015-06-11 19:24:00 +0200 | [diff] [blame] | 647 | expect(menu.item(0).active()).toBe(false); |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 648 | }); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 649 | }); |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 650 | |
| 651 | // table = view.toTable(); |
| 652 | // table.sortBy(''); |
| 653 | // table.element(); |
| 654 | // tree = view.toTree(); |
| 655 | // tree.element(); |
Nils Diewald | a297f06 | 2015-04-02 00:23:46 +0000 | [diff] [blame] | 656 | }); |