Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1037408
matrix-room-list-test.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
matrix-room-list-test.cpp
View Options
/*
* This file is part of kazv.
* SPDX-FileCopyrightText: 2023 tusooa <tusooa@kazv.moe>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#include
<libkazv-config.hpp>
#include
<immer/config.hpp>
// https://github.com/arximboldi/immer/issues/168
#include
<memory>
#include
<QtTest>
#include
<matrix-room-timeline.hpp>
#include
<matrix-sdk.hpp>
#include
<matrix-room-list.hpp>
#include
<matrix-room.hpp>
#include
<matrix-event.hpp>
#include
"test-model.hpp"
#include
"test-utils.hpp"
using
namespace
Kazv
;
class
MatrixRoomListTest
:
public
QObject
{
Q_OBJECT
private
Q_SLOTS
:
void
testRoomList
();
};
void
MatrixRoomListTest::testRoomList
()
{
auto
model
=
makeTestModel
();
RoomModel
room
;
room
.
roomId
=
"!test:tusooa.xyz"
;
room
.
accountData
=
room
.
accountData
.
set
(
"m.tag"
,
Event
{
R
"
(
{
"content": {
"tags": {"m.favourite": {}}
},
"type": "m.tag"
}
)
"
_json
});
model
.
client
.
roomList
.
rooms
=
model
.
client
.
roomList
.
rooms
.
set
(
room
.
roomId
,
room
);
std
::
unique_ptr
<
MatrixSdk
>
sdk
{
makeTestSdk
(
model
)};
auto
roomList
=
toUniquePtr
(
sdk
->
roomList
());
QCOMPARE
(
roomList
->
count
(),
2
);
roomList
->
setTagId
(
"m.favourite"
);
QCOMPARE
(
roomList
->
count
(),
1
);
roomList
->
setTagId
(
"u.xxx"
);
QCOMPARE
(
roomList
->
count
(),
0
);
}
QTEST_MAIN
(
MatrixRoomListTest
)
#include
"matrix-room-list-test.moc"
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Wed, May 14, 7:14 AM (1 d, 11 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
99902
Default Alt Text
matrix-room-list-test.cpp (1 KB)
Attached To
Mode
rK kazv
Attached
Detach File
Event Timeline
Log In to Comment