Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.

Commit

Permalink
Merge pull request #712 from wymeditor/fix-some-test
Browse files Browse the repository at this point in the history
native_edits_reg edited calls test: fix expected # of callbacks
  • Loading branch information
winhamwr committed Apr 27, 2015
2 parents cb0a146 + 60dd3dd commit 1e8875c
Showing 1 changed file with 6 additions and 5 deletions.
Expand Up @@ -43,17 +43,18 @@ QUnit.test("'edited' modification callbacks are firing on" +
p = wymeditor.$body().find("p")[0];
wymeditor.setCaretIn(p);

simulateKeyCombo(wymeditor, 'a'); // 1st callback
wymeditor.undoRedo.reset();
simulateKeyCombo(wymeditor, 'a'); // no callback
simulateKeyCombo(wymeditor, '3'); // no callback
simulateKeyCombo(wymeditor, ' '); // 2nd callback
simulateKeyCombo(wymeditor, ' '); // 1st callback
simulateKeyCombo(wymeditor, ' '); // no callback
simulateKeyCombo(wymeditor, '.'); // 3rd callback
simulateKeyCombo(wymeditor, '.'); // 2nd callback

callCount = wymeditor.registerModification.callCount;
QUnit.strictEqual(
callCount,
3,
"`registerModification` called 3 times"
2,
"`registerModification` called twice"
);

wymeditor.registerModification.restore();
Expand Down

0 comments on commit 1e8875c

Please sign in to comment.