"
should = "some link to somewhere"
- result = App.Utils.htmlCleanup( $(source) )
- equal( result.html(), should, source )
+ result = App.Utils.htmlCleanup($(source))
+ equal(result.html(), should, source)
source = "
"
- result = App.Utils.htmlCleanup( $(source) )
- equal( result.html(), should, source )
+ result = App.Utils.htmlCleanup($(source))
+ equal(result.html(), should, source)
source = "
"
- result = App.Utils.htmlCleanup( $(source) )
- equal( result.html(), should, source )
+ result = App.Utils.htmlCleanup($(source))
+ equal(result.html(), should, source)
source = "
"
- result = App.Utils.htmlRemoveRichtext( $(source) )
- equal( result.html(), should, source )
+ result = App.Utils.htmlRemoveRichtext($(source))
+ equal(result.html(), should, source)
source = "
"
should = "test 123"
- result = App.Utils.htmlRemoveRichtext( $(source) )
- equal( result.html(), should, source )
+ result = App.Utils.htmlRemoveRichtext($(source))
+ equal(result.html(), should, source)
source = "
"
should = "test 123 some other value"
- result = App.Utils.htmlRemoveRichtext( $(source) )
- equal( result.html(), should, source )
+ result = App.Utils.htmlRemoveRichtext($(source))
+ equal(result.html(), should, source)
source = "
"
should = "test 123 some other value"
- result = App.Utils.htmlRemoveRichtext( $(source) )
- equal( result.html(), should, source )
+ result = App.Utils.htmlRemoveRichtext($(source))
+ equal(result.html(), should, source)
source = "
"
should = "This is some text!"
- result = App.Utils.htmlRemoveRichtext( $(source) )
- equal( result.html(), should, source )
+ result = App.Utils.htmlRemoveRichtext($(source))
+ equal(result.html(), should, source)
source = "
some link to somewhere from wordabc
"
should = "
some link to somewhere from wordabc
"
- result = App.Utils.htmlCleanup( $(source) )
- equal( result.html(), should, source )
+ result = App.Utils.htmlCleanup($(source))
+ equal(result.html(), should, source)
});
// wrap
-test( "wrap", function() {
+test("wrap", function() {
var source = "some text"
var should = 'some text'
- var result = App.Utils.wrap( source )
- equal( result, should, source )
+ var result = App.Utils.wrap(source)
+ equal(result, should, source)
source = "some text\nsome other text\n"
should = "some text\nsome other text\n"
- result = App.Utils.wrap( source )
- equal( result, should, source )
+ result = App.Utils.wrap(source)
+ equal(result, should, source)
source = "some text with some line to wrap"
should = "some text with\nsome line to\nwrap"
- result = App.Utils.wrap( source, 14 )
- equal( result, should, source )
+ result = App.Utils.wrap(source, 14)
+ equal(result, should, source)
source = "some text\nsome other text\n"
should = "some text\nsome other text\n"
- result = App.Utils.wrap( source )
- equal( result, should, source )
+ result = App.Utils.wrap(source)
+ equal(result, should, source)
source = "1234567890 1234567890 1234567890 1234567890"
should = "1234567890 1234567890 1234567890 1234567890"
- result = App.Utils.wrap( source )
- equal( result, should, source )
+ result = App.Utils.wrap(source)
+ equal(result, should, source)
source = "123456789012 123456789012 123456789012"
should = "123456789012\n123456789012\n123456789012"
- result = App.Utils.wrap( source, 14 )
- equal( result, should, source )
+ result = App.Utils.wrap(source, 14)
+ equal(result, should, source)
});
// quote
-test( "quote", function() {
+test("quote", function() {
var source = "some text"
var should = '> some text'
- var result = App.Utils.quote( source )
- equal( result, should, source )
+ var result = App.Utils.quote(source)
+ equal(result, should, source)
source = "some text\nsome other text\n"
should = "> some text\n> some other text"
- result = App.Utils.quote( source )
- equal( result, should, source )
+ result = App.Utils.quote(source)
+ equal(result, should, source)
source = "\n\nsome text\nsome other text\n \n"
should = "> some text\n> some other text"
- result = App.Utils.quote( source )
- equal( result, should, source )
+ result = App.Utils.quote(source)
+ equal(result, should, source)
source = "Welcome!\n\nThank you for installing Zammad.\n\nYou will find ..."
should = "> Welcome!\n>\n> Thank you for installing Zammad.\n>\n> You will find ..."
- result = App.Utils.quote( source )
- equal( result, should, source )
+ result = App.Utils.quote(source)
+ equal(result, should, source)
source = "Welcome! Thank you for installing Zammad. You will find ..."
should = "> Welcome! Thank you\n> for installing\n> Zammad. You will\n> find ..."
- result = App.Utils.quote( source, 20 )
- equal( result, should, source )
+ result = App.Utils.quote(source, 20)
+ equal(result, should, source)
});
// check signature
-test( "check signature", function() {
+test("check signature", function() {
var message = "
test 123
"
var signature = '
--
Some Signature
some department
'
- var result = App.Utils.signatureCheck( message, signature )
- equal( result, true )
+ var result = App.Utils.signatureCheck(message, signature)
+ equal(result, true)
message = "
test 123
--
Some Signature
some department\n
"
signature = '
--
Some Signature
some department
'
- result = App.Utils.signatureCheck( message, signature )
- equal( result, false )
+ result = App.Utils.signatureCheck(message, signature)
+ equal(result, false)
message = "
test 123
--
Some Signature\n
some department\n
"
signature = '
--
Some Signature
some department
'
- result = App.Utils.signatureCheck( message, signature )
- equal( result, false )
+ result = App.Utils.signatureCheck(message, signature)
+ equal(result, false)
message = "
test 123
--
Some Signature
\n
some department
\n\n
"
signature = '
--
Some Signature
some department
'
- result = App.Utils.signatureCheck( message, signature )
- equal( result, false )
+ result = App.Utils.signatureCheck(message, signature)
+ equal(result, false)
message = ""
signature = '
--
Some Signature
some department
'
- result = App.Utils.signatureCheck( message, signature )
- equal( result, true )
+ result = App.Utils.signatureCheck(message, signature)
+ equal(result, true)
message = ""
signature = "--\nSome Signature\nsome department"
- result = App.Utils.signatureCheck( message, signature )
- equal( result, true )
+ result = App.Utils.signatureCheck(message, signature)
+ equal(result, true)
});
// identify signature
-test( "identify signature", function() {
+test("identify signature", function() {
var message = "
test 123
"
var should = '
test 123
'
- var result = App.Utils.signatureIdentify( message )
- equal( result, should )
+ var result = App.Utils.signatureIdentify(message)
+ equal(result, should)
message = "
test 123
--
Bob Smith
"
should = '
test 123
--
Bob Smith
'
- result = App.Utils.signatureIdentify( message )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message)
+ equal(result, should)
message = "
test 123
1
2
3
4
5
6
7
8
9
--
Bob Smith
"
should = '
test 123
1
2
3
4
5
6
7
8
9
--
Bob Smith
'
- result = App.Utils.signatureIdentify( message )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message)
+ equal(result, should)
message = "
test 123
--no not match--
--
Bob Smith
"
should = '
test 123
--no not match--
--
Bob Smith
'
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
message = "
test 123
--no not match--
--
Bob Smith
"
should = '
test 123
--no not match--
--
Bob Smith
'
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
message = "
test 123
--
Bob Smith
--
Bob Smith
"
should = '
test 123
--
Bob Smith
--
Bob Smith
'
//should = '
test 123
--
Bob Smith
--
Bob Smith
'
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
message = "
test 123
test 123
--
Bob Smith
"
should = "
test 123
test 123
--
Bob Smith
"
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
message = "
test 123
test 123
--
Bob Smith
"
should = "
test 123
test 123
--
Bob Smith
"
- result = App.Utils.signatureIdentify( message, true )
+ result = App.Utils.signatureIdentify(message, true)
// apple
// en
message = "
test 123
--no not match--
Bob Smith
On 01/04/15 10:55, Bob Smith wrote:
lalala
--
some test
"
should = '
test 123
--no not match--
Bob Smith
On 01/04/15 10:55, Bob Smith wrote:
lalala
--
some test
'
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
// de
message = "
test 123
--no not match--
Bob Smith
Am 03.04.2015 um 20:58 schrieb Bob Smith <bob@example.com>:
lalala
"
should = '
test 123
--no not match--
Bob Smith
Am 03.04.2015 um 20:58 schrieb Bob Smith <bob@example.com>:
lalala
'
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
// ms
// en
message = "
test 123
--no not match--
Bob Smith
From: Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]
Sent: Donnerstag, 2. April 2015 10:00
lalala
"
should = '
test 123
--no not match--
Bob Smith
From: Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]
Sent: Donnerstag, 2. April 2015 10:00
lalala
'
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
message = "
test 123
--no not match--
Bob Smith
From: Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]
Sent: Donnerstag, 2. April 2015 10:00
Subject: lalala
"
should = '
test 123
--no not match--
Bob Smith
From: Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]
Sent: Donnerstag, 2. April 2015 10:00
Subject: lalala
'
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
message = "
test 123
--no not match--
Bob Smith
From: Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]
Sent: Donnerstag, 2. April 2015 10:00
1
2
3
4
4
Subject: lalala
"
should = '
test 123
--no not match--
Bob Smith
From: Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]
Sent: Donnerstag, 2. April 2015 10:00
1
2
3
4
4
Subject: lalala
'
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
// de
message = "
test 123
--no not match--
Bob Smith
Von: Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]
Gesendet: Donnerstag, 2. April 2015 10:00
Betreff: lalala
"
should = '
test 123
--no not match--
Bob Smith
Von: Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]
Gesendet: Donnerstag, 2. April 2015 10:00
Betreff: lalala
'
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
message = "
1
\n
Gesendet: Donnerstag, 2. April 2015 11:32
"
should = "
1
\n
Gesendet: Donnerstag, 2. April 2015 11:32
"
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
message = "
1
\n
Gesendet: Donnerstag, 2. April 2015 11:32
Betreff: lalala
"
should = "
1
\n
Gesendet: Donnerstag, 2. April 2015 11:32
Betreff: lalala
"
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
message = "
1
\n
An: somebody
Datum: Donnerstag, 2. April 2015 11:32
Betreff: lalala
"
should = "
1
\n
An: somebody
Datum: Donnerstag, 2. April 2015 11:32
Betreff: lalala
"
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
message = "
Gesendet: Donnerstag, 2. April 2015 10:11:12
Betreff: Angebot Redundanz / Paket mit Silver Subscription [Ticket#424242]
Hallo Frau Smith,
"
should = "
Gesendet: Donnerstag, 2. April 2015 10:11:12
Betreff: Angebot Redundanz / Paket mit Silver Subscription [Ticket#424242]
Hallo Frau Smith,
"
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
// fr
message = "
test 123
--no not match--
Bob Smith
De : Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]
Envoyé : mercredi 29 avril 2015 17:31
Objet : lalala
"
should = '
test 123
--no not match--
Bob Smith
De : Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]
Envoyé : mercredi 29 avril 2015 17:31
Objet : lalala
'
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
// thunderbird
// de
message = "
Viele Grüße,
Christian
Am 04.03.2015 um 12:47 schrieb Martin Edenhofer via Znuny Sales:
> Hallo Christian,
"
should = "
Viele Grüße,
Christian
Am 04.03.2015 um 12:47 schrieb Martin Edenhofer via Znuny Sales:
> Hallo Christian,
"
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
// en - Thunderbird default - http://kb.mozillazine.org/Reply_header_settings
message = "
Viele Grüße,
Christian
On 01-01-2007 11:00 AM, Alf Aardvark wrote:
> Hallo Christian,
"
should = "
Viele Grüße,
Christian
On 01-01-2007 11:00 AM, Alf Aardvark wrote:
> Hallo Christian,
"
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
// en - http://kb.mozillazine.org/Reply_header_settings
message = "
Viele Grüße,
Christian
Alf Aardvark wrote, on 01-01-2007 11:00 AM:
> Hallo Christian,
"
should = "
Viele Grüße,
Christian
Alf Aardvark wrote, on 01-01-2007 11:00 AM:
> Hallo Christian,
"
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
// otrs
// en
message = "
test 123
--no not match--
Bob Smith
01/04/15 10:55 - Bob Smith wrote:
lalala
"
should = '
test 123
--no not match--
Bob Smith
01/04/15 10:55 - Bob Smith wrote:
lalala
'
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
// de
message = "
test 123
--no not match--
Bob Smith
01/04/15 10:55 - Bob Smith schrieb:
lalala
"
should = '
test 123
--no not match--
Bob Smith
01/04/15 10:55 - Bob Smith schrieb:
lalala
'
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
message = "
test 123
24.02.2015 14:20 - Roy Kaldung via Znuny Sales schrieb:
"
should = "
test 123
24.02.2015 14:20 - Roy Kaldung via Znuny Sales schrieb:
"
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
// zammad
message = "
test 123
--no not match--
Bob Smith
lalala
"
should = "
test 123
--no not match--
Bob Smith
lalala
"
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
message = "
test 123
--no not match--
Bob Smith
lalala
"
should = "
test 123
--no not match--
Bob Smith
lalala
"
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
// gmail
message = "
test 123
--no not match--
Bob Smith
lalala
"
should = "
test 123
--no not match--
Bob Smith
lalala
"
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
message = "
test 123
--no not match--
Bob Smith
lalala
"
should = "
test 123
--no not match--
Bob Smith
lalala
"
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
message = "
test 123
--no not match--
Bob Smith
Am 24. Dezember 2015 um 07:45 schrieb kathrine <kathrine@example.com>:
lalala
"
should = "
test 123
--no not match--
Bob Smith
Am 24. Dezember 2015 um 07:45 schrieb kathrine <kathrine@example.com>:
lalala
"
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
// word 14
// en
message = "
test 123
--no not match--
Bob Smith
Bob Smith wrote:
lalala
"
should = '
test 123
--no not match--
Bob Smith
Bob Smith wrote:
lalala
'
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
// de
message = "
test 123
--no not match--
Bob Smith
Bob Smith schrieb:
lalala
"
should = '
test 123
--no not match--
Bob Smith
Bob Smith schrieb:
lalala
'
- result = App.Utils.signatureIdentify( message, true )
- equal( result, should )
+ result = App.Utils.signatureIdentify(message, true)
+ equal(result, should)
});
// replace tags
-test( "check replace tags", function() {
+test("check replace tags", function() {
var message = "
#{user.firstname} #{user.lastname}
"
var result = '
Bob Smith
'
@@ -732,8 +732,8 @@ test( "check replace tags", function() {
lastname: 'Smith',
},
}
- var verify = App.Utils.replaceTags( message, data )
- equal( verify, result )
+ var verify = App.Utils.replaceTags(message, data)
+ equal(verify, result)
message = "
#{user.firstname} #{user.lastname}
"
result = '
Bob Smith
'
@@ -743,8 +743,8 @@ test( "check replace tags", function() {
lastname: function() { return 'Smith' },
},
}
- verify = App.Utils.replaceTags( message, data )
- equal( verify, result )
+ verify = App.Utils.replaceTags(message, data)
+ equal(verify, result)
message = "
#{user.firstname} #{user.lastname}
"
result = '
Bob
'
@@ -753,129 +753,129 @@ test( "check replace tags", function() {
firstname: 'Bob',
},
}
- verify = App.Utils.replaceTags( message, data )
- equal( verify, result )
+ verify = App.Utils.replaceTags(message, data)
+ equal(verify, result)
});
// check if last line is a empty line
-test( "check if last line is a empty line", function() {
+test("check if last line is a empty line", function() {
var message = "123"
var result = false
- var verify = App.Utils.lastLineEmpty( message )
- equal( verify, result, message )
+ var verify = App.Utils.lastLineEmpty(message)
+ equal(verify, result, message)
message = "
123
"
result = false
- verify = App.Utils.lastLineEmpty( message )
- equal( verify, result, message )
+ verify = App.Utils.lastLineEmpty(message)
+ equal(verify, result, message)
message = "
123
"
result = false
- verify = App.Utils.lastLineEmpty( message )
- equal( verify, result, message )
+ verify = App.Utils.lastLineEmpty(message)
+ equal(verify, result, message)
message = "
"
result = true
- verify = App.Utils.lastLineEmpty( message )
- equal( verify, result, message )
+ verify = App.Utils.lastLineEmpty(message)
+ equal(verify, result, message)
message = "
"
result = true
- verify = App.Utils.lastLineEmpty( message )
- equal( verify, result, message )
+ verify = App.Utils.lastLineEmpty(message)
+ equal(verify, result, message)
message = "
"
result = true
- verify = App.Utils.lastLineEmpty( message )
- equal( verify, result, message )
+ verify = App.Utils.lastLineEmpty(message)
+ equal(verify, result, message)
message = "
\n \n\t"
result = true
- verify = App.Utils.lastLineEmpty( message )
- equal( verify, result, message )
+ verify = App.Utils.lastLineEmpty(message)
+ equal(verify, result, message)
message = "
\n \n\t"
result = true
- verify = App.Utils.lastLineEmpty( message )
- equal( verify, result, message )
+ verify = App.Utils.lastLineEmpty(message)
+ equal(verify, result, message)
message = "
\n
\n \n\t"
result = true
- verify = App.Utils.lastLineEmpty( message )
- equal( verify, result, message )
+ verify = App.Utils.lastLineEmpty(message)
+ equal(verify, result, message)
});
// check attibute validation
-test( "check attibute validation", function() {
+test("check attibute validation", function() {
var string = '123'
- var result = '123'
- var verify = App.Utils.htmlAttributeCleanup( string )
- equal( verify, result, string )
+ var result = '123'
+ var verify = App.Utils.htmlAttributeCleanup(string)
+ equal(verify, result, string)
string = '123!'
- result = '123'
- verify = App.Utils.htmlAttributeCleanup( string )
- equal( verify, result, string )
+ result = '123'
+ verify = App.Utils.htmlAttributeCleanup(string)
+ equal(verify, result, string)
string = '12 3!'
- result = '123'
- verify = App.Utils.htmlAttributeCleanup( string )
- equal( verify, result, string )
+ result = '123'
+ verify = App.Utils.htmlAttributeCleanup(string)
+ equal(verify, result, string)
string = '12-3!'
- result = '12-3'
- verify = App.Utils.htmlAttributeCleanup( string )
- equal( verify, result, string )
+ result = '12-3'
+ verify = App.Utils.htmlAttributeCleanup(string)
+ equal(verify, result, string)
string = '12_3!'
- result = '12_3'
- verify = App.Utils.htmlAttributeCleanup( string )
- equal( verify, result, string )
+ result = '12_3'
+ verify = App.Utils.htmlAttributeCleanup(string)
+ equal(verify, result, string)
string = '^12_3!'
- result = '12_3'
- verify = App.Utils.htmlAttributeCleanup( string )
- equal( verify, result, string )
+ result = '12_3'
+ verify = App.Utils.htmlAttributeCleanup(string)
+ equal(verify, result, string)
string = '^1\n 2_3!'
- result = '12_3'
- verify = App.Utils.htmlAttributeCleanup( string )
- equal( verify, result, string )
+ result = '12_3'
+ verify = App.Utils.htmlAttributeCleanup(string)
+ equal(verify, result, string)
string = 'abc?'
- result = 'abc'
- verify = App.Utils.htmlAttributeCleanup( string )
- equal( verify, result, string )
+ result = 'abc'
+ verify = App.Utils.htmlAttributeCleanup(string)
+ equal(verify, result, string)
string = 'abc."'
- result = 'abc'
- verify = App.Utils.htmlAttributeCleanup( string )
- equal( verify, result, string )
+ result = 'abc'
+ verify = App.Utils.htmlAttributeCleanup(string)
+ equal(verify, result, string)
string = '#abc!^'
- result = 'abc'
- verify = App.Utils.htmlAttributeCleanup( string )
- equal( verify, result, string )
+ result = 'abc'
+ verify = App.Utils.htmlAttributeCleanup(string)
+ equal(verify, result, string)
string = 'abc()=$'
- result = 'abc'
- verify = App.Utils.htmlAttributeCleanup( string )
- equal( verify, result, string )
+ result = 'abc'
+ verify = App.Utils.htmlAttributeCleanup(string)
+ equal(verify, result, string)
string = "abc()=$\n123\rß"
- result = 'abc123'
- verify = App.Utils.htmlAttributeCleanup( string )
- equal( verify, result, string )
+ result = 'abc123'
+ verify = App.Utils.htmlAttributeCleanup(string)
+ equal(verify, result, string)
});
// check form diff
-test( "check form diff", function() {
+test("check form diff", function() {
var dataNow = {
owner_id: 1,
@@ -886,8 +886,8 @@ test( "check form diff", function() {
pending_date: '2015-01-28T09:39:00Z',
}
var diff = {}
- var result = App.Utils.formDiff( dataNow, dataLast )
- deepEqual( result, diff, 'check form diff' );
+ var result = App.Utils.formDiff(dataNow, dataLast)
+ deepEqual(result, diff, 'check form diff')
dataNow = {
@@ -899,8 +899,8 @@ test( "check form diff", function() {
pending_date: '2015-01-28T09:39:00Z',
}
diff = {}
- result = App.Utils.formDiff( dataNow, dataLast )
- deepEqual( result, diff, 'check form diff' );
+ result = App.Utils.formDiff(dataNow, dataLast)
+ deepEqual(result, diff, 'check form diff')
dataNow = {
@@ -911,8 +911,8 @@ test( "check form diff", function() {
pending_date: '2015-01-28T09:39:00Z',
}
diff = {}
- result = App.Utils.formDiff( dataNow, dataLast )
- deepEqual( result, diff, 'check form diff' );
+ result = App.Utils.formDiff(dataNow, dataLast)
+ deepEqual(result, diff, 'check form diff')
dataNow = {
@@ -925,8 +925,8 @@ test( "check form diff", function() {
diff = {
owner_id: '',
}
- result = App.Utils.formDiff( dataNow, dataLast )
- deepEqual( result, diff, 'check form diff' );
+ result = App.Utils.formDiff(dataNow, dataLast)
+ deepEqual(result, diff, 'check form diff')
dataNow = {
@@ -938,8 +938,8 @@ test( "check form diff", function() {
owner_id: '',
state_ids: ['1','5','6','7'],
}
- result = App.Utils.formDiff( dataNow, dataLast )
- deepEqual( result, diff, 'check form diff' );
+ result = App.Utils.formDiff(dataNow, dataLast)
+ deepEqual(result, diff, 'check form diff')
dataNow = {
@@ -951,8 +951,8 @@ test( "check form diff", function() {
state_ids: [1,5,6,7],
}
diff = {}
- result = App.Utils.formDiff( dataNow, dataLast )
- deepEqual( result, diff, 'check form diff' );
+ result = App.Utils.formDiff(dataNow, dataLast)
+ deepEqual(result, diff, 'check form diff')
dataNow = {
@@ -966,8 +966,8 @@ test( "check form diff", function() {
owner_id: '',
state_ids: ['6'],
}
- result = App.Utils.formDiff( dataNow, dataLast )
- deepEqual( result, diff, 'check form diff' );
+ result = App.Utils.formDiff(dataNow, dataLast)
+ deepEqual(result, diff, 'check form diff')
dataNow = {
@@ -979,8 +979,8 @@ test( "check form diff", function() {
state_ids: [1,5,6,7],
}
diff = {}
- result = App.Utils.formDiff( dataNow, dataLast )
- deepEqual( result, diff, 'check form diff' );
+ result = App.Utils.formDiff(dataNow, dataLast)
+ deepEqual(result, diff, 'check form diff')
dataNow = {
@@ -994,8 +994,8 @@ test( "check form diff", function() {
diff = {
owner_id: ''
}
- result = App.Utils.formDiff( dataNow, dataLast )
- deepEqual( result, diff, 'check form diff' );
+ result = App.Utils.formDiff(dataNow, dataLast)
+ deepEqual(result, diff, 'check form diff')
dataNow = {
@@ -1010,8 +1010,8 @@ test( "check form diff", function() {
state_id: '4',
pending_time: '2015-01-28T11:34:00Z'
}
- result = App.Utils.formDiff( dataNow, dataLast )
- deepEqual( result, diff, 'check form diff' );
+ result = App.Utils.formDiff(dataNow, dataLast)
+ deepEqual(result, diff, 'check form diff')
dataNow = {
@@ -1021,8 +1021,8 @@ test( "check form diff", function() {
pending_time: null
}
diff = {}
- result = App.Utils.formDiff( dataNow, dataLast )
- deepEqual( result, diff, 'check form diff' );
+ result = App.Utils.formDiff(dataNow, dataLast)
+ deepEqual(result, diff, 'check form diff')
dataNow = {
@@ -1036,8 +1036,8 @@ test( "check form diff", function() {
},
}
diff = {}
- result = App.Utils.formDiff( dataNow, dataLast )
- deepEqual( result, diff, 'check form diff' );
+ result = App.Utils.formDiff(dataNow, dataLast)
+ deepEqual(result, diff, 'check form diff')
dataNow = {
@@ -1053,8 +1053,8 @@ test( "check form diff", function() {
},
}
diff = {}
- result = App.Utils.formDiff( dataNow, dataLast )
- deepEqual( result, diff, 'check form diff' );
+ result = App.Utils.formDiff(dataNow, dataLast)
+ deepEqual(result, diff, 'check form diff')
dataNow = {
@@ -1064,8 +1064,8 @@ test( "check form diff", function() {
diff = {
test: '123',
}
- result = App.Utils.formDiff( dataNow, dataLast )
- deepEqual( result, diff, 'check form diff' );
+ result = App.Utils.formDiff(dataNow, dataLast)
+ deepEqual(result, diff, 'check form diff')
dataNow = {
@@ -1077,8 +1077,8 @@ test( "check form diff", function() {
diff = {
test: '123',
}
- result = App.Utils.formDiff( dataNow, dataLast )
- deepEqual( result, diff, 'check form diff' );
+ result = App.Utils.formDiff(dataNow, dataLast)
+ deepEqual(result, diff, 'check form diff')
dataNow = {
@@ -1093,8 +1093,8 @@ test( "check form diff", function() {
diff = {
test: '123',
}
- result = App.Utils.formDiff( dataNow, dataLast )
- deepEqual( result, diff, 'check form diff' );
+ result = App.Utils.formDiff(dataNow, dataLast)
+ deepEqual(result, diff, 'check form diff')
dataNow = {
@@ -1106,8 +1106,8 @@ test( "check form diff", function() {
diff = {
test: ['1','2','3','4']
}
- result = App.Utils.formDiff( dataNow, dataLast )
- deepEqual( result, diff, 'check form diff' );
+ result = App.Utils.formDiff(dataNow, dataLast)
+ deepEqual(result, diff, 'check form diff')
dataNow = {
@@ -1125,8 +1125,8 @@ test( "check form diff", function() {
2: '2',
}
}
- result = App.Utils.formDiff( dataNow, dataLast )
- deepEqual( result, diff, 'check form diff' );
+ result = App.Utils.formDiff(dataNow, dataLast)
+ deepEqual(result, diff, 'check form diff')
dataNow = {
@@ -1143,23 +1143,23 @@ test( "check form diff", function() {
diff = {
test: '123',
}
- result = App.Utils.formDiff( dataNow, dataLast )
- deepEqual( result, diff, 'check form diff' );
+ result = App.Utils.formDiff(dataNow, dataLast)
+ deepEqual(result, diff, 'check form diff')
dataNow = undefined
dataLast = undefined
diff = {}
- result = App.Utils.formDiff( dataNow, dataLast )
- deepEqual( result, diff, 'check form diff' );
+ result = App.Utils.formDiff(dataNow, dataLast)
+ deepEqual(result, diff, 'check form diff')
dataNow = {}
dataLast = {"number":"10012","title":"some subject 123äöü","group_id":1,"owner_id":1,"customer_id":2,"state_id":3,"priority_id":2,"article":{"from":"Test Master Agent","to":"","cc":"","body":"dasdad","content_type":"text/html","ticket_id":12,"type_id":9,"sender_id":1,"internal":false,"form_id":"523405147"},"updated_at":"2015-01-29T09:22:23.000Z","pending_time":"2015-01-28T22:22:00.000Z","id":12}
diff = {}
- result = App.Utils.formDiff( dataNow, dataLast )
- deepEqual( result, diff, 'check form diff' );
+ result = App.Utils.formDiff(dataNow, dataLast)
+ deepEqual(result, diff, 'check form diff')
// do not compare content of data instances/objects
no = function test_object() {
@@ -1185,9 +1185,8 @@ test( "check form diff", function() {
diff = {
number:'10013',
}
- result = App.Utils.formDiff( dataNow, dataLast )
- deepEqual( result, diff, 'check form diff' );
-
+ result = App.Utils.formDiff(dataNow, dataLast)
+ deepEqual(result, diff, 'check form diff')
dataNow = {
number:'10013',
@@ -1202,65 +1201,93 @@ test( "check form diff", function() {
number:'10013',
Article: ['2'],
}
- result = App.Utils.formDiff( dataNow, dataLast )
- deepEqual( result, diff, 'check form diff' );
-
+ result = App.Utils.formDiff(dataNow, dataLast)
+ deepEqual(result, diff, 'check form diff')
});
// check decimal format
-test( "check decimal format", function() {
+test("check decimal format", function() {
var string = '123'
- var result = '123.00'
- var verify = App.Utils.decimal( string )
- equal( verify, result, string )
+ var result = '123.00'
+ var verify = App.Utils.decimal(string)
+ equal(verify, result, string)
string = '0.6'
- result = '0.60'
- verify = App.Utils.decimal( string )
- equal( verify, result, string )
+ result = '0.60'
+ verify = App.Utils.decimal(string)
+ equal(verify, result, string)
string = '6'
- result = '6.00'
- verify = App.Utils.decimal( string )
- equal( verify, result, string )
+ result = '6.00'
+ verify = App.Utils.decimal(string)
+ equal(verify, result, string)
string = 6.5
- result = '6.50'
- verify = App.Utils.decimal( string )
- equal( verify, result, string )
+ result = '6.50'
+ verify = App.Utils.decimal(string)
+ equal(verify, result, string)
string = '111111.6'
- result = '111111.60'
- verify = App.Utils.decimal( string )
- equal( verify, result, string )
+ result = '111111.60'
+ verify = App.Utils.decimal(string)
+ equal(verify, result, string)
string = '111111.622'
- result = '111111.62'
- verify = App.Utils.decimal( string )
- equal( verify, result, string )
+ result = '111111.62'
+ verify = App.Utils.decimal(string)
+ equal(verify, result, string)
string = 'abc.6'
- result = 'abc.6'
- verify = App.Utils.decimal( string )
- equal( verify, result, string )
+ result = 'abc.6'
+ verify = App.Utils.decimal(string)
+ equal(verify, result, string)
+
+ string = ''
+ result = ''
+ verify = App.Utils.decimal(string)
+ equal(verify, result, string)
+
+ string = undefined
+ result = ''
+ verify = App.Utils.decimal(string)
+ equal(verify, result, string)
+
+ string = null
+ result = ''
+ verify = App.Utils.decimal(string)
+ equal(verify, result, string)
});
// check formatTime format
-test( "check formatTime format", function() {
+test("check formatTime format", function() {
var string = '123'
- var result = '123'
- var verify = App.Utils.formatTime( string, 0 )
- equal( verify, result, string )
+ var result = '123'
+ var verify = App.Utils.formatTime(string, 0)
+ equal(verify, result, string)
string = '6'
- result = '06'
- verify = App.Utils.formatTime( string, 2 )
- equal( verify, result, string )
+ result = '06'
+ verify = App.Utils.formatTime(string, 2)
+ equal(verify, result, string)
+ string = ''
+ result = '00'
+ verify = App.Utils.formatTime(string, 2)
+ equal(verify, result, string)
+
+ string = undefined
+ result = ''
+ verify = App.Utils.formatTime(string, 2)
+ equal(verify, result, string)
+
+ string = null
+ result = ''
+ verify = App.Utils.formatTime(string, 2)
+ equal(verify, result, string)
});
}
\ No newline at end of file