Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F7889495
tst_EventHistoryView.qml
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
tst_EventHistoryView.qml
View Options
/*
* This file is part of kazv.
* SPDX-FileCopyrightText: 2024 tusooa <tusooa@kazv.moe>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import
QtQuick
import
QtQuick
.
Layouts
import
QtTest
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
room:
({
messageById:
(
_id
)
=>
item
.
textEvent
,
member:
(
_id
)
=>
({}),
})
property
var
history:
ListModel
{
ListElement
{}
ListElement
{}
function
at
(
index
)
{
return
{
type:
'm.room.message'
,
content:
{
msgtype:
'm.text'
,
body:
`
version
$
{
index
}
`
,
},
sender:
'@foo:example.com'
,
};
}
}
Kazv
.
EventHistoryView
{
id: eventHistoryView
anchors.fill:
parent
history:
item
.
history
}
TestCase
{
id: eventHistoryViewTest
name:
'EventHistoryViewTest'
function
test_history
()
{
tryVerify
(()
=>
eventHistoryView
.
itemAtIndex
(
0
));
const
v0
=
eventHistoryView
.
itemAtIndex
(
0
);
verify
(
findChild
(
v0
,
'timeIndicator'
).
visible
);
compare
(
findChild
(
v0
,
'textEventContent'
).
text
,
'version 0'
);
tryVerify
(()
=>
eventHistoryView
.
itemAtIndex
(
1
));
compare
(
findChild
(
eventHistoryView
.
itemAtIndex
(
1
),
'textEventContent'
).
text
,
'version 1'
);
}
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Oct 2, 2:34 AM (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
471302
Default Alt Text
tst_EventHistoryView.qml (1 KB)
Attached To
Mode
rK kazv
Attached
Detach File
Event Timeline
Log In to Comment