mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-02 18:36:24 +00:00
fix(app): fix code style in spec files
This commit is contained in:
parent
7b99d70d98
commit
37e7954c9e
4 changed files with 33 additions and 30 deletions
|
|
@ -6,25 +6,6 @@ import QtTest 1.1
|
|||
TestCase {
|
||||
id: testCase
|
||||
|
||||
name: 'ConfirmDialogTests'
|
||||
|
||||
Component {
|
||||
id: builder
|
||||
|
||||
Item {
|
||||
ConfirmDialog {
|
||||
id: confirmDialog
|
||||
}
|
||||
|
||||
SignalSpy {
|
||||
id: spy
|
||||
|
||||
signalName: 'exitStatus'
|
||||
target: confirmDialog
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function buildConfirmDialog () {
|
||||
var container = builder.createObject(testCase)
|
||||
verify(container)
|
||||
|
|
@ -35,6 +16,8 @@ TestCase {
|
|||
return container
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
function test_exitStatusViaButtons_data () {
|
||||
return [
|
||||
{ button: 0, expectedStatus: 0 },
|
||||
|
|
@ -52,6 +35,8 @@ TestCase {
|
|||
compare(spy.signalArguments[0][0], data.expectedStatus)
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
function test_exitStatusViaClose () {
|
||||
var container = buildConfirmDialog()
|
||||
var dialog = container.data[0]
|
||||
|
|
@ -61,4 +46,23 @@ TestCase {
|
|||
spy.wait(100)
|
||||
compare(spy.signalArguments[0][0], 0)
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
Component {
|
||||
id: builder
|
||||
|
||||
Item {
|
||||
ConfirmDialog {
|
||||
id: confirmDialog
|
||||
}
|
||||
|
||||
SignalSpy {
|
||||
id: spy
|
||||
|
||||
signalName: 'exitStatus'
|
||||
target: confirmDialog
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,14 @@ import QtTest 1.1
|
|||
Item {
|
||||
id: root
|
||||
|
||||
function buildExclusiveButtons (defaultSelectedButton) {
|
||||
var container = builder.createObject(root)
|
||||
testCase.verify(container)
|
||||
|
||||
container.data[0].selectedButton = defaultSelectedButton
|
||||
return container
|
||||
}
|
||||
|
||||
// Avoid `Test 'XXX' has invalid size QSize(0, 0), resizing.` warning.
|
||||
height: 100
|
||||
width: 300
|
||||
|
|
@ -35,17 +43,10 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
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 () {
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ Rectangle {
|
|||
{ x: item.x + item.width - 1, y: item.y },
|
||||
{ x: item.x, y: item.y + item.height - 1},
|
||||
{ x: item.x + item.width - 1, y: item.y + item.height - 1 },
|
||||
{ } // item center.
|
||||
{ } // (x, y) = item center.
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ import './utils.js' as Utils
|
|||
TestCase {
|
||||
id: testCase
|
||||
|
||||
name: 'UtilsTests'
|
||||
|
||||
// Test only if a confirm dialog can be opened.
|
||||
// The other tests are launched by `ConfirmDialog.spec.qml`.
|
||||
function test_openConfirmDialog () {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue