Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F114691
D169.1732569455.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D169.1732569455.diff
View Options
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
@@ -168,22 +168,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',
@@ -458,20 +442,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
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 25, 1:17 PM (11 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40338
Default Alt Text
D169.1732569455.diff (3 KB)
Attached To
Mode
D169: Split video event tests into its own file
Attached
Detach File
Event Timeline
Log In to Comment