FIX: Dirty edit can toggle to another edit.

This commit is contained in:
Guo Xiang Tan
2015-08-24 22:55:56 +08:00
parent ca6fcfd001
commit f98eddb675
3 changed files with 23 additions and 3 deletions

View File

@ -200,6 +200,21 @@ test("Composer can switch between edits", () => {
});
});
test("Composer with dirty edit can toggle to another edit", () => {
visit("/t/this-is-a-test-topic/9");
click('.topic-post:eq(0) button[data-action=edit]');
fillIn('.wmd-input', 'This is a dirty reply');
click('.topic-post:eq(1) button[data-action=edit]');
andThen(() => {
ok(exists('.bootbox.modal'), 'it pops up a confirmation dialog');
});
click('.modal-footer a:eq(0)');
andThen(() => {
equal(find('.wmd-input').val().indexOf('This is the second post.'), 0, 'it populates the input with the post text');
});
});
test("Composer can toggle between edit and reply", () => {
visit("/t/this-is-a-test-topic/9");