This repository has been archived by the owner on Apr 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 114
Correct broken list structure on list actions #333
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c05600a
Added some failing unit tests showing over-closed list problems.
winhamwr 7e2b24c
Added scripts to run the unit tests with phantomjs.
winhamwr 58c247d
Added jquery helpers for prev/next but including all nodes.
winhamwr d2b2b65
Fixed actual list nesting, but need to bail out on the actual list ac…
winhamwr 3d13e73
Tweaked list correction to at least remove exceptions
winhamwr fcc5151
List correction working in FF and chrome. Almost there...
winhamwr 0149be3
Dead end towards list correction on ie8. Hanging closing li tag
winhamwr fd432a5
So it turns out there's actually a parser error.
winhamwr 675714e
Merge remote branch 'origin/master' into issue_nesting_correction
winhamwr 359bb80
Really? Bleed between parser runs? Fail. Still needs IE cleanup
winhamwr f9f35cb
Refs #333. IE likes to add random whitespace. Obliged.
winhamwr fcc6932
Refs #333. Added a parser test showing the ie list over-closing bug.
winhamwr 614b24c
Refs #333. Fixed a parser bug around list selection and text nodes
winhamwr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
UNIT_TEST_URL=http://$1/index.html?tapOutput=true; | ||
BUILD_DIR="`dirname \"$0\"`" | ||
phantomjs $BUILD_DIR/run_qunit.js $UNIT_TEST_URL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/** | ||
* Wait until the test condition is true or a timeout occurs. Useful for waiting | ||
* on a server response or for a ui change (fadeIn, etc.) to occur. | ||
* | ||
* @param testFx Callback that evaluates to a boolean, | ||
* @param onReady Callback to execute on succesful completion | ||
* @param timeOutMillis the max amount of time to wait. If not specified, 3 sec is used. | ||
*/ | ||
function waitFor(testFx, onReady, timeOutMillis) { | ||
var maxtimeOutMillis = timeOutMillis ? timeOutMillis : 3001, //< Default Max Timout is 3s | ||
start = new Date().getTime(), | ||
condition = false, | ||
interval = setInterval(function() { | ||
if ( (new Date().getTime() - start < maxtimeOutMillis) && !condition ) { | ||
// If not time-out yet and condition not yet fulfilled | ||
condition = testFx(); | ||
} else { | ||
if(!condition) { | ||
// If condition still not fulfilled (timeout but condition is 'false') | ||
console.log("# 'waitFor()' timeout"); | ||
phantom.exit(1); | ||
} else { | ||
// Condition fulfilled (timeout and/or condition is 'true') | ||
// console.log("'waitFor()' finished in " + (new Date().getTime() - start) + "ms."); | ||
onReady(); //< Do what it's supposed to do once the condition is fulfilled | ||
clearInterval(interval); //< Stop this interval | ||
} | ||
} | ||
}, 100); //< repeat check every 100ms | ||
} | ||
|
||
|
||
if (phantom.args.length === 0 || phantom.args.length > 2) { | ||
console.log('Usage: run-qunit.js URL'); | ||
phantom.exit(1); | ||
} | ||
|
||
var page = new WebPage(); | ||
|
||
// Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this") | ||
page.onConsoleMessage = function(msg) { | ||
console.log(msg); | ||
}; | ||
|
||
// Open the URL of the first argument, wait for the results to finish and then output a summary. | ||
// Exists with 0 on success, 1 with failures, 2 with a phantomjs error | ||
page.open(phantom.args[0], function(status){ | ||
if (status !== "success") { | ||
console.log("Unable to access network"); | ||
phantom.exit(2); | ||
} else { | ||
waitFor( | ||
function(){ | ||
return page.evaluate(function(){ | ||
var el = document.getElementById('qunit-testresult'); | ||
if (el && el.innerText.match('completed')) { | ||
return true; | ||
} | ||
return false; | ||
}); | ||
}, | ||
function(){ | ||
// Output the summary and return 1 if it was an all-pass | ||
var returnCode = page.evaluate(function() { | ||
var failString = ''; | ||
var results = document.getElementById('qunit-testresult'); | ||
console.log(results.innerText); | ||
try { | ||
failString = el.getElementsByClassName('failed')[0].innerHTML; | ||
} catch (e) { } | ||
if (parseInt(failString, 10) > 0) { | ||
return 1; // Failures | ||
} | ||
return 0; // All pass | ||
}); | ||
phantom.exit(returnCode); | ||
}, | ||
15000 // 15 seconds timeout | ||
); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment should read 'return 0 if it was an all-pass'