Commit 37e7954c authored by Ronan Abhamon's avatar Ronan Abhamon

fix(app): fix code style in spec files

parent 7b99d70d
......@@ -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 () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment