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
6705553a
Commit
6705553a
authored
Oct 21, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(Form/ExclusiveButtons): add spec file to test emitted signals
parent
4694dbdb
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
99 additions
and
24 deletions
+99
-24
ConfirmDialog.spec.qml
tests/ui/modules/Common/Dialog/ConfirmDialog.spec.qml
+11
-16
ExclusiveButtons.qml
tests/ui/modules/Common/Form/ExclusiveButtons.qml
+4
-4
ExclusiveButtons.spec.qml
tests/ui/modules/Common/Form/ExclusiveButtons.spec.qml
+80
-0
InvertedMouseArea.qml
tests/ui/modules/Common/InvertedMouseArea.qml
+1
-1
DropDownMenu.qml
tests/ui/modules/Common/Popup/DropDownMenu.qml
+1
-1
ScrollableListView.qml
tests/ui/modules/Common/View/ScrollableListView.qml
+1
-1
Contact.qml
tests/ui/views/MainWindow/Contact.qml
+1
-1
No files found.
tests/ui/modules/Common/Dialog/ConfirmDialog.spec.qml
View file @
6705553a
...
...
@@ -8,20 +8,15 @@ TestCase {
name
:
'
ConfirmDialogTests
'
function
createDialog
()
{
var
component
=
Qt
.
createComponent
(
'
./ConfirmDialog.qml
'
)
if
(
component
.
status
!==
Component
.
Ready
)
{
if
(
component
.
status
===
Component
.
Error
)
{
fail
(
'
Error:
'
+
component
.
errorString
())
}
else
{
fail
(
'
Dialog not ready.
'
)
}
}
var
dialog
=
component
.
createObject
(
testCase
)
Component
{
id
:
builder
ConfirmDialog
{}
}
function
buildConfirmDialog
()
{
var
dialog
=
builder
.
createObject
(
testCase
)
verify
(
dialog
)
dialog
.
closing
.
connect
(
dialog
.
destroy
.
bind
(
dialog
))
return
dialog
}
...
...
@@ -34,7 +29,7 @@ TestCase {
}
function
test_exitStatusViaButtons
(
data
)
{
var
dialog
=
create
Dialog
()
var
dialog
=
buildConfirm
Dialog
()
dialog
.
exitStatus
.
connect
(
function
(
status
)
{
compare
(
status
,
data
.
expectedStatus
)
...
...
@@ -44,7 +39,7 @@ TestCase {
}
function
test_exitStatusViaClose
()
{
var
dialog
=
create
Dialog
()
var
dialog
=
buildConfirm
Dialog
()
dialog
.
exitStatus
.
connect
(
function
(
status
)
{
compare
(
status
,
0
)
...
...
tests/ui/modules/Common/Form/ExclusiveButtons.qml
View file @
6705553a
...
...
@@ -9,7 +9,7 @@ Row {
property
var
texts
property
int
_
selectedButton
:
0
property
int
selectedButton
:
0
signal
clicked
(
int
button
)
...
...
@@ -20,7 +20,7 @@ Row {
SmallButton
{
anchors.verticalCenter
:
parent
.
verticalCenter
backgroundColor
:
_
selectedButton
===
index
backgroundColor
:
selectedButton
===
index
?
ExclusiveButtonsStyle
.
button
.
color
.
selected
:
(
down
?
ExclusiveButtonsStyle
.
button
.
color
.
pressed
...
...
@@ -32,8 +32,8 @@ Row {
text
:
modelData
onClicked
:
{
if
(
_
selectedButton
!==
index
)
{
_
selectedButton
=
index
if
(
selectedButton
!==
index
)
{
selectedButton
=
index
item
.
clicked
(
index
)
}
}
...
...
tests/ui/modules/Common/Form/ExclusiveButtons.spec.qml
0 → 100644
View file @
6705553a
import
QtQuick
2.7
import
QtTest
1.1
// ===================================================================
Item
{
id
:
root
Component
{
id
:
builder
Item
{
ExclusiveButtons
{
id
:
exclusiveButtons
texts
:
[
qsTr
(
'
A
'
),
qsTr
(
'
B
'
),
qsTr
(
'
C
'
),
qsTr
(
'
D
'
),
qsTr
(
'
E
'
)
]
}
SignalSpy
{
id
:
spy
signalName
:
'
clicked
'
target
:
exclusiveButtons
}
}
}
function
buildExclusiveButtons
(
defaultSelectedButton
)
{
var
container
=
builder
.
createObject
(
root
)
testCase
.
verify
(
container
)
container
.
data
[
0
].
selectedButton
=
defaultSelectedButton
return
container
}
TestCase
{
id
:
testCase
name
:
'
ExclusiveButtonsTests
'
when
:
windowShown
function
test_signals_data
()
{
return
[
{
defaultSelectedButton
:
0
,
buttonToClick
:
2
},
{
defaultSelectedButton
:
1
,
buttonToClick
:
4
},
{
defaultSelectedButton
:
3
,
buttonToClick
:
1
},
{
defaultSelectedButton
:
4
,
buttonToClick
:
0
}
]
}
function
test_signals
(
data
)
{
var
container
=
buildExclusiveButtons
(
data
.
defaultSelectedButton
)
var
spy
=
container
.
data
[
1
]
var
exclusiveButtons
=
container
.
data
[
0
]
var
buttonToClick
=
data
.
buttonToClick
// Test default selected button.
compare
(
exclusiveButtons
.
selectedButton
,
data
.
defaultSelectedButton
)
// Test a click to change the selected button.
mouseClick
(
exclusiveButtons
.
data
[
buttonToClick
])
spy
.
wait
(
100
)
compare
(
spy
.
signalArguments
[
0
][
0
],
buttonToClick
)
compare
(
exclusiveButtons
.
selectedButton
,
buttonToClick
)
// No signal must be emitted.
mouseClick
(
exclusiveButtons
.
data
[
buttonToClick
])
wait
(
100
)
compare
(
spy
.
count
,
1
)
container
.
destroy
()
}
}
}
tests/ui/modules/Common/InvertedMouseArea.qml
View file @
6705553a
...
...
@@ -16,7 +16,7 @@ Item {
function
_createMouseArea
()
{
if
(
_mouseArea
==
null
)
{
_mouseArea
=
builder
.
createObject
(
this
)
_mouseArea
=
builder
.
createObject
()
}
_mouseArea
.
parent
=
(
function
()
{
...
...
tests/ui/modules/Common/Popup/DropDownMenu.qml
View file @
6705553a
...
...
@@ -38,7 +38,7 @@ Rectangle {
layer
{
enabled
:
true
effect
:
PopupShadow
{
}
effect
:
PopupShadow
{}
}
}
}
tests/ui/modules/Common/View/ScrollableListView.qml
View file @
6705553a
...
...
@@ -6,7 +6,7 @@ import Common 1.0
// ===================================================================
ListView
{
ScrollBar.vertical
:
ForceScrollBar
{
}
ScrollBar.vertical
:
ForceScrollBar
{}
boundsBehavior
:
Flickable
.
StopAtBounds
clip
:
true
spacing
:
0
...
...
tests/ui/views/MainWindow/Contact.qml
View file @
6705553a
...
...
@@ -68,7 +68,7 @@ ColumnLayout {
Flickable
{
Layout.fillHeight
:
true
Layout.fillWidth
:
true
ScrollBar.vertical
:
ForceScrollBar
{
}
ScrollBar.vertical
:
ForceScrollBar
{}
boundsBehavior
:
Flickable
.
StopAtBounds
clip
:
true
contentHeight
:
content
.
height
...
...
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