Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1037617
tst_DeviceList.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_DeviceList.qml
View Options
/*
* 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
QtTest
1.0
import
'../../contents/ui/device-mgmt'
as
KazvDM
import
'test-helpers.js'
as
Helpers
Item
{
width:
800
height:
600
property
var
l10n:
Helpers
.
fluentMock
property
var
deviceItems:
[
{
deviceId:
'some-id'
,
displayName:
'name'
,
trustLevel:
'unseen'
},
{
deviceId:
'some-id2'
,
displayName:
'name2'
,
trustLevel:
'unseen'
},
]
property
var
deviceListModel:
({
count:
2
,
at:
(
index
)
=>
{
return
deviceItems
[
index
]
||
{}
},
})
KazvDM
.
DeviceList
{
id: deviceList
}
TestCase
{
id: deviceListTest
name:
'DeviceListTest'
when:
windowShown
function
initTestCase
()
{
deviceList
.
devices
=
deviceListModel
;
}
function
test_deviceList
()
{
verify
(
deviceList
.
model
===
2
);
deviceList
.
currentIndex
=
0
;
verify
(
findChild
(
deviceList
.
itemAtIndex
(
0
)));
verify
(
findChild
(
deviceList
.
itemAtIndex
(
0
),
'deviceIdLabel'
).
text
===
'some-id'
);
deviceList
.
currentIndex
=
1
;
tryVerify
(()
=>
findChild
(
deviceList
.
itemAtIndex
(
1
)),
1000
);
tryVerify
(()
=>
findChild
(
deviceList
.
itemAtIndex
(
1
),
'deviceIdLabel'
).
text
===
'some-id2'
,
1000
);
}
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, May 14, 7:32 AM (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
90694
Default Alt Text
tst_DeviceList.qml (1 KB)
Attached To
Mode
rK kazv
Attached
Detach File
Event Timeline
Log In to Comment