mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 08:15:02 +00:00
Add libraries/emoji/test module with picker fakes
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2026 Element Creations Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id("io.element.android-compose-library")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "io.element.android.libraries.emoji.test"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api(projects.libraries.emoji.api)
|
||||
implementation(projects.libraries.architecture)
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2026 Element Creations Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.libraries.emoji.test
|
||||
|
||||
import io.element.android.libraries.emoji.api.picker.EmojiPickerPresenter
|
||||
import io.element.android.libraries.emoji.api.picker.EmojiPickerState
|
||||
|
||||
fun fakeEmojiPickerPresenter(
|
||||
state: EmojiPickerState = FakeEmojiPickerState(),
|
||||
): EmojiPickerPresenter = EmojiPickerPresenter { state }
|
||||
|
||||
fun fakeEmojiPickerPresenterFactory(
|
||||
presenter: EmojiPickerPresenter = fakeEmojiPickerPresenter(),
|
||||
): EmojiPickerPresenter.Factory = EmojiPickerPresenter.Factory { presenter }
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2026 Element Creations Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.libraries.emoji.test
|
||||
|
||||
import io.element.android.libraries.emoji.api.picker.EmojiPickerState
|
||||
|
||||
/**
|
||||
* Minimal [EmojiPickerState] for use in tests that don't render the picker (typically presenter
|
||||
* tests).
|
||||
*/
|
||||
data class FakeEmojiPickerState(
|
||||
override val isReady: Boolean = true,
|
||||
) : EmojiPickerState
|
||||
Reference in New Issue
Block a user