adding tests for PasteViewer class

This commit is contained in:
El RIDO 2017-11-21 10:53:33 +01:00
parent 10ee37b35c
commit c6ddee317d
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
4 changed files with 78 additions and 4 deletions

View file

@ -1839,7 +1839,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
*
* @name PasteViewer.setFormat
* @function
* @param {string} newFormat the the new format
* @param {string} newFormat the new format
*/
me.setFormat = function(newFormat)
{
@ -1848,7 +1848,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
return;
}
// needs to update display too, if from or to Markdown is switched
// needs to update display too, if we switch from or to Markdown
if (format === 'markdown' || newFormat === 'markdown') {
isDisplayed = false;
}
@ -1977,6 +1977,9 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
// get default option from template/HTML or fall back to set value
format = Model.getFormatDefault() || format;
text = '';
isDisplayed = false;
isChanged = true;
}
return me;