Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
e92e44f2
Commit
e92e44f2
authored
Nov 10, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(Utils): add tests for `isArray`
parent
735bd32b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
33 deletions
+52
-33
utils.spec.qml
tests/ui/scripts/Utils/utils.spec.qml
+52
-33
No files found.
tests/ui/scripts/Utils/utils.spec.qml
View file @
e92e44f2
...
@@ -33,21 +33,6 @@ TestCase {
...
@@ -33,21 +33,6 @@ TestCase {
// -----------------------------------------------------------------
// -----------------------------------------------------------------
function
test_snakeToCamel_data
()
{
return
[
{
input
:
'
foo_bar
'
,
output
:
'
fooBar
'
},
{
input
:
'
george_abitbol
'
,
output
:
'
georgeAbitbol
'
},
{
input
:
'
billTremendousAndHubert
'
,
output
:
'
billTremendousAndHubert
'
},
{
input
:
'
foo_bAr_BAZ
'
,
output
:
'
fooBArBAZ
'
}
]
}
function
test_snakeToCamel
(
data
)
{
compare
(
Utils
.
snakeToCamel
(
data
.
input
),
data
.
output
)
}
// -----------------------------------------------------------------
function
test_setTimeoutWithoutParent
()
{
function
test_setTimeoutWithoutParent
()
{
try
{
try
{
Utils
.
setTimeout
(
null
,
0
,
function
()
{
Utils
.
setTimeout
(
null
,
0
,
function
()
{
...
@@ -138,24 +123,6 @@ TestCase {
...
@@ -138,24 +123,6 @@ TestCase {
// -----------------------------------------------------------------
// -----------------------------------------------------------------
function
test_isString_data
()
{
return
[
{
input
:
'
foo
'
,
output
:
true
},
{
input
:
Object
(
'
bar
'
),
output
:
true
},
{
input
:
[
0
],
output
:
false
},
{
input
:
/baz/
,
output
:
false
},
{
input
:
new
Error
,
output
:
false
},
{
input
:
true
,
output
:
false
},
{
input
:
42
,
output
:
false
}
]
}
function
test_isString
(
data
)
{
compare
(
Utils
.
isString
(
data
.
input
),
data
.
output
)
}
// -----------------------------------------------------------------
function
test_genRandomNumber_data
()
{
function
test_genRandomNumber_data
()
{
return
[
return
[
{
min
:
42
,
max
:
3600
},
{
min
:
42
,
max
:
3600
},
...
@@ -212,6 +179,58 @@ TestCase {
...
@@ -212,6 +179,58 @@ TestCase {
})
})
}
}
// -----------------------------------------------------------------
function
test_isArray_data
()
{
return
[
{
input
:
[],
output
:
true
},
{
input
:
{},
output
:
false
},
{
input
:
[
6
],
output
:
true
},
{
input
:
/bar/
,
output
:
false
},
{
input
:
new
Error
,
output
:
false
},
{
input
:
true
,
output
:
false
},
{
input
:
42
,
output
:
false
},
{
input
:
new
Array
(),
output
:
true
}
]
}
function
test_isArray
(
data
)
{
compare
(
Utils
.
isArray
(
data
.
input
),
data
.
output
)
}
// -----------------------------------------------------------------
function
test_isString_data
()
{
return
[
{
input
:
'
foo
'
,
output
:
true
},
{
input
:
Object
(
'
bar
'
),
output
:
true
},
{
input
:
[
0
],
output
:
false
},
{
input
:
/baz/
,
output
:
false
},
{
input
:
new
Error
,
output
:
false
},
{
input
:
true
,
output
:
false
},
{
input
:
42
,
output
:
false
}
]
}
function
test_isString
(
data
)
{
compare
(
Utils
.
isString
(
data
.
input
),
data
.
output
)
}
// -----------------------------------------------------------------
function
test_snakeToCamel_data
()
{
return
[
{
input
:
'
foo_bar
'
,
output
:
'
fooBar
'
},
{
input
:
'
george_abitbol
'
,
output
:
'
georgeAbitbol
'
},
{
input
:
'
billTremendousAndHubert
'
,
output
:
'
billTremendousAndHubert
'
},
{
input
:
'
foo_bAr_BAZ
'
,
output
:
'
fooBArBAZ
'
}
]
}
function
test_snakeToCamel
(
data
)
{
compare
(
Utils
.
snakeToCamel
(
data
.
input
),
data
.
output
)
}
// -----------------------------------------------------------------
// -----------------------------------------------------------------
function
test_startsWith_data
()
{
function
test_startsWith_data
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment