Files
RedBear-OS/local/recipes/kde/kirigami/source/autotests/tst_card.qml
T
2026-04-14 10:51:06 +01:00

70 lines
1.4 KiB
QML

/*
* SPDX-FileCopyrightText: 2024 ivan tkachenko <me@ratijas.tk>
*
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
import QtQuick
import QtQuick.Controls as QQC2
import org.kde.kirigami as Kirigami
import QtTest
TestCase {
name: "Cards"
visible: true
when: windowShown
width: 500
height: 500
Component {
id: cardComponent
Kirigami.Card {}
}
Component {
id: itemComponent
Item {}
}
Component {
id: cardWithActionsComponent
Kirigami.Card {
actions: [
QQC2.Action {
text: "QQC2"
},
Kirigami.Action {
text: "Kirigami"
}
]
}
}
function test_init() {
const card = createTemporaryObject(cardComponent, this);
verify(card);
}
function test_customFooter() {
const card = createTemporaryObject(cardComponent, this);
verify(card);
const item = createTemporaryObject(itemComponent, this);
verify(item);
const defaultFooter = card.footer;
verify(defaultFooter.visible);
verify(defaultFooter.parent !== null);
card.footer = item;
verify(item.visible);
verify(!defaultFooter.visible);
}
function test_cardWithActions() {
const card = createTemporaryObject(cardWithActionsComponent, this);
verify(card);
}
}