I don't see the point of checking visualEditorStub.isDirty() == false on line 101. Of course it it is false-- you've set your mock to always return that value.

Testing whether isDirty returned false used to make sense because we changed the value of isNotDirty in the code itself (and we wanted to make sure that happened-- that's why the mock initially had the value false, and we expected the code to change it to true).

Can you changed the isDirty mocked method so it uses the same calculation that tinyMCE does? If it turns out there is nothing meaningful to test about isDirty, then at least remove the assertions that simply check the mocked value.