InfiniteQueryTestTag

open class InfiniteQueryTestTag<T, S>(val tag: String) : TestTag

TestTag implementation for InfiniteQuery operations that provides tag-based identification.

This class is used to identify infinite queries for mocking in test and preview environments, particularly when dealing with auto-generated query IDs that may change during configuration changes or recompositions.

Unlike InfiniteQueryId which might use auto-generated values that can change across recompositions, InfiniteQueryTestTag provides a stable identifier that can be consistently referenced in tests and previews.

Usage example:

// Define a test tag
class UserListQueryTestTag : InfiniteQueryTestTag<User, PageParams>("user-list")

// Use with test client
testClient.on(UserListQueryTestTag()) { QueryState.success(mockUserChunks) }

// Apply when getting an infinite query
val query = client.getInfiniteQuery(queryKey, Marker.testTag(UserListQueryTestTag()))

Parameters

T

The type of data that will be returned by the infinite query

S

The type of pagination parameters for loading more data

tag

A unique string identifier for this test tag

Constructors

Link copied to clipboard
constructor(tag: String)

Properties

Link copied to clipboard
open override val tag: String

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int