aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quickcontrols2/controls/data/tst_dayofweekrow.qml
blob: e341e0eb2ab3e3c9d2d85d5fc2a5518ebc33876a (plain)
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
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

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 test_locale() {
        var 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() {
        var control = component.createObject(testCase)

        verify(control.contentItem.children[0])

        control.font.pixelSize = 123
        compare(control.contentItem.children[0].font.pixelSize, 123)

        control.destroy()
    }
}