1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick
import QtQuick.Controls
import QtTest
TestCase {
id: testCase
width: 400
height: 400
visible: true
when: windowShown
name: "DayOfWeekRow"
Component {
id: component
DayOfWeekRow { }
}
function init () {
failOnWarning(/.?/)
}
function test_defaults() {
let control = createTemporaryObject(component, testCase)
verify(control)
}
function test_locale() {
let control = component.createObject(testCase)
verify(control.contentItem.children[0])
control.locale = Qt.locale("en_US")
compare(control.contentItem.children[0].text, "Sun")
control.locale = Qt.locale("no_NO")
compare(control.contentItem.children[0].text, "man.")
control.locale = Qt.locale("fi_FI")
compare(control.contentItem.children[0].text, "ma")
control.destroy()
}
function test_font() {
let control = component.createObject(testCase)
verify(control.contentItem.children[0])
control.font.pixelSize = 123
compare(control.contentItem.children[0].font.pixelSize, 123)
control.destroy()
}
}
|