Opened 12 years ago
Closed 12 years ago
#9848 closed Bug (fixed)
Failing command test after switching off selectionChange's errorProof flag
Reported by: | Piotrek Koszuliński | Owned by: | Olek Nowodziński |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 4.0.2 |
Component: | General | Version: | 4.0.1 |
Keywords: | Cc: |
Description
- Switch off errorProof flag on selectionChange event (see selection.js).
- One test is faling on: http://ckeditor4.t/dt/core/command/command.html
Hint: it doesn't fail when ran alone - http://ckeditor4.t/dt/core/command/command.html?name=test-command-states-in-detailssummary
Change History (7)
comment:1 Changed 12 years ago by
Status: | new → confirmed |
---|
comment:2 Changed 12 years ago by
Owner: | set to Olek Nowodziński |
---|---|
Status: | confirmed → assigned |
comment:3 Changed 12 years ago by
Status: | assigned → review |
---|
comment:4 Changed 12 years ago by
Status: | review → assigned |
---|
Before considering the proposed workaround, I would ask to investigate if it is possible instead to fix selectionChange, to avoid "selectionChange fire multiple times before the right HTML is set".
comment:5 Changed 12 years ago by
Status: | assigned → review |
---|
Pushed new solution to t/9848b@tests-v4.
- Fixed 1. from comment:3 by avoiding additional
selectionChange
because of editor.focus() inCKTESTER.tools.setHtmlWithSelection
in IE>8 and other browsers. This change seems to not interact with other tests.
- Ported some part of solution for 2. from previous branch.
This combo is much simpler and cleaner than t/9848@tests-v4.
comment:6 Changed 12 years ago by
Status: | review → review_passed |
---|
I'm assuming this fix is not needed for IE<9.
comment:7 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | review_passed → closed |
Added info regarding IE versions. Fixed with 89814fa@tests-v4.
Created branch with fix in t/9848@tests-v4.
There are two reasons for this issue:
editorBot.setHtmlWithSelection()
is noisy and makesselectionChange
fire multiple times before the right HTML is set and the right selection is done. This distracts command's refresh callback and yields bad asserts since it callsrefresh
onselectionChange
ifcontextSensitive: true
. This is a bad testing method for delicate, selection-dependent features.In fact, the problem wasn't "test command states in details>summary" (first one) but "test "contextSensitive" property" (last one). I changed the way the command is tested and eventually removed it so it's
refresh()
isn't executed anymore in the future.