Page MenuHomePhorge

D169.1732488927.diff
No OneTemporary

Size
3 KB
Referenced Files
None
Subscribers
None

D169.1732488927.diff

diff --git a/src/tests/quick-tests/tst_EventView.qml b/src/tests/quick-tests/tst_EventView.qml
--- a/src/tests/quick-tests/tst_EventView.qml
+++ b/src/tests/quick-tests/tst_EventView.qml
@@ -169,22 +169,6 @@
formattedTime: '4:06 P.M.',
})
- property var videoEvent: ({
- eventId: '',
- sender: '@foo:tusooa.xyz',
- type: 'm.room.message',
- stateKey: '',
- content: {
- msgtype: 'm.image',
- body: 'some body',
- info: {
- h: Kirigami.Units.gridUnit * 10,
- w: Kirigami.Units.gridUnit * 10,
- }
- },
- formattedTime: '4:06 P.M.',
- })
-
property var eventBySomeoneElse: ({
eventId: '',
sender: '@bar:tusooa.xyz',
@@ -460,20 +444,6 @@
sender: item.sender
}
-
- Kazv.EventView {
- id: eventViewVideo
- event: item.videoEvent
- sender: item.sender
- }
-
- Kazv.EventView {
- id: eventViewVideoCompact
- compactMode: true
- event: item.videoEvent
- sender: item.sender
- }
-
Kazv.EventView {
Layout.fillWidth: true
id: eventViewEdited
@@ -693,15 +663,6 @@
verify(image.height <= Kirigami.Units.gridUnit * 5);
}
- function test_videoEvent() {
- verify(!findChild(eventViewVideo, 'summaryLabel').visible);
- verify(findChild(eventViewVideo, 'bodyLabel').visible);
- verify(findChild(eventViewVideoCompact, 'summaryLabel').visible);
- verify(!findChild(eventViewVideoCompact, 'bodyLabel').visible);
- const image = findChild(eventViewVideoCompact, 'mainImage');
- verify(image.height <= Kirigami.Units.gridUnit * 5);
- }
-
function test_history() {
{
const menuComp = findChild(eventViewText, 'bubble').menuComp;
diff --git a/src/tests/quick-tests/tst_EventViewVideo.qml b/src/tests/quick-tests/tst_EventViewVideo.qml
new file mode 100644
--- /dev/null
+++ b/src/tests/quick-tests/tst_EventViewVideo.qml
@@ -0,0 +1,72 @@
+/*
+ * This file is part of kazv.
+ * SPDX-FileCopyrightText: 2023 tusooa <tusooa@kazv.moe>
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+import QtQuick 2.3
+import QtQuick.Layouts 1.15
+import QtTest 1.0
+
+import moe.kazv.mxc.kazv 0.0 as MK
+import org.kde.kirigami 2.13 as Kirigami
+import '../../contents/ui' as Kazv
+import 'test-helpers.js' as Helpers
+import 'test-helpers' as TestHelpers
+
+Item {
+ id: item
+ width: 800
+ height: 600
+
+ property var mockHelper: TestHelpers.MockHelper {}
+ property var videoEvent: ({
+ eventId: '',
+ sender: '@foo:tusooa.xyz',
+ type: 'm.room.message',
+ stateKey: '',
+ content: {
+ msgtype: 'm.image',
+ body: 'some body',
+ info: {
+ h: Kirigami.Units.gridUnit * 10,
+ w: Kirigami.Units.gridUnit * 10,
+ }
+ },
+ formattedTime: '4:06 P.M.',
+ })
+
+ ColumnLayout {
+ anchors.fill: parent
+ Kazv.EventView {
+ id: eventViewVideo
+ event: item.videoEvent
+ sender: item.sender
+ }
+
+ Kazv.EventView {
+ id: eventViewVideoCompact
+ compactMode: true
+ event: item.videoEvent
+ sender: item.sender
+ }
+ }
+
+ TestCase {
+ id: eventViewVideoTest
+ name: 'EventViewVideoTest'
+ when: windowShown
+
+ function init() {
+ }
+
+ function test_videoEvent() {
+ verify(!findChild(eventViewVideo, 'summaryLabel').visible);
+ verify(findChild(eventViewVideo, 'bodyLabel').visible);
+ verify(findChild(eventViewVideoCompact, 'summaryLabel').visible);
+ verify(!findChild(eventViewVideoCompact, 'bodyLabel').visible);
+ const image = findChild(eventViewVideoCompact, 'mainImage');
+ verify(image.height <= Kirigami.Units.gridUnit * 5);
+ }
+ }
+}

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 2:55 PM (13 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39900
Default Alt Text
D169.1732488927.diff (3 KB)

Event Timeline