Page MenuHomePhorge

tst_AvatarImageAdapters.qml
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

tst_AvatarImageAdapters.qml

/*
* 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' as QmlHelpers
QmlHelpers.TestItem {
id: item
ColumnLayout {
Kazv.AvatarAdapter {
id: avatar
mxcUri: 'mxc://example.com/xxx'
}
Kazv.ImageAdapter {
id: image
mxcUri: 'mxc://example.com/yyy'
}
}
TestCase {
id: avatarImageAdaptersTest
name: 'AvatarImageAdaptersTest'
when: windowShown
function init() {
item.mockHelper.clearAll();
}
function test_avatarReactive() {
compare(item.kazvIOManager.cacheFile.calledTimes(), 0);
avatar.mxcUri = 'mxc://example.com/zzz';
compare(item.kazvIOManager.cacheFile.calledTimes(), 1);
}
function test_imageReactive() {
compare(item.kazvIOManager.cacheFile.calledTimes(), 0);
image.mxcUri = 'mxc://example.com/zzz';
compare(item.kazvIOManager.cacheFile.calledTimes(), 1);
}
}
}

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 3:50 PM (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39467
Default Alt Text
tst_AvatarImageAdapters.qml (1 KB)

Event Timeline