OLD | NEW |
(Empty) | |
| 1 This test verifies Ctrl-D functionality, which selects next occurrence of word. |
| 2 |
| 3 function wordData() { |
| 4 return { |
| 5 original: $(".entry.original > .input").text(), |
| 6 translation: $(".entry.translation > .input").text(), |
| 7 tags: $(".active-tags > .tagcloud > .tag").toArray().map(function(value)
{ return value.textContent; }) |
| 8 }; |
| 9 } |
| 10 |
| 11 function submitWord(url) { |
| 12 var stub = new App.Stub($(".content")); |
| 13 $.post(url, wordData()) |
| 14 .done(function() { |
| 15 var callback = $("meta[data-callback]").attr("data-callback"); |
| 16 if (callback) { |
| 17 window.location = callback; |
| 18 } else { |
| 19 stub.success(); |
| 20 $(".entry.original > .input").text("").focus(); |
| 21 $(".entry.translation > .input").text(""); |
| 22 } |
| 23 }) |
| 24 .fail(function(obj, err, errDescr) { |
| 25 stub.failure("Error: " + errDescr); |
| 26 }) |
| 27 } |
| 28 |
| 29 Running: testNextFullWord |
| 30 'function': 3 |
| 31 |
| 32 Running: testOccurrencesOnTheSameLine |
| 33 'original': 3 |
| 34 |
| 35 Running: testTwoCloseWords |
| 36 'text': 4 |
| 37 |
| 38 Running: testCursorInTheWordStart |
| 39 'function': 1 |
| 40 |
| 41 Running: testCursorInTheWordEnd |
| 42 'function': 1 |
| 43 |
| 44 Running: testNonWordSelection |
| 45 '$(': 7 |
| 46 |
| 47 Running: testNonWordSelection2 |
| 48 ' > ': 6 |
| 49 |
| 50 Running: testNonWordSelection3 |
| 51 'window.location': 1 |
| 52 'success': 1 |
| 53 'text(': 1 |
| 54 |
| 55 Running: testNonWordSelection4 |
| 56 'text(': 4 |
| 57 'dow.locati': 1 |
| 58 'es': 1 |
| 59 |
| 60 Running: testTriggerWordSearchInMixedCase |
| 61 'stub = new App.Stub': 1 |
| 62 'callback': 5 |
| 63 |
OLD | NEW |