Sign in Get 3 free credits

Try a job or a niche: tiktok captions, study notes, excel formulas. Press Esc to close.

Compose Lazy List Tests

Writes reliable tests for LazyColumn and LazyRow scrolling and visibility, so offscreen items cannot fool you.

Claude's review

7/10 Solid lazy list test patterns: scroll by key, assertIsDisplayed over assertExists, layoutInfo as ground truth and frame stepping.

We asked Claude the question you would ask: would I be glad I installed this? Two separate reviews, the second blind to the first, must both rate a skill 7 or higher before we sell it.

In detail

Use this skill to test `LazyColumn`, `LazyRow`, and `LazyVerticalGrid` correctly — tag the container with `Modifier.testTag(...)`, tag each item by its key, scroll via the semantic action (`hasScrollAction()`, `performScrollToIndex`, `performScrollToKey`) or via `Modifier.testTag` plus `performTouchInput { swipeUp() }`, and verify visibility with `assertIsDisplayed` (NOT `assertExists`, since off-screen lazy items still exist as semantic nodes in some configurations). Covers `LazyListState.layoutInfo.visibleItemsInfo` as the highest-signal probe, `mainClock.autoAdvance = false` for animated item placement, and the parameterized vertical/horizontal base-class pattern. Use when the developer asks "how do I scroll a LazyColumn in a test", "assertExists vs assertIsDisplayed", "scroll to a key", "test item placement animation", or sees a test pass when an item is off-screen.

How you use it

  1. Add it to your pack, then download your pack (1 credit).
  2. In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
  3. Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide

Safety check

Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.

An automated scan lowers risk but cannot promise zero risk. How we check skills

Preview

The first lines of SKILL.md
---
name: testing-lazy-lists
description: Use this skill to test `LazyColumn`, `LazyRow`, and `LazyVerticalGrid` correctly — tag the container with `Modifier.testTag(...)`, tag each item by its key, scroll via the semantic action (`hasScrollAction()`, `performScrollToIndex`, `performScrollToKey`) or via `Modifier.testTag` plus `performTouchInput { swipeUp() }`, and verify visibility with `assertIsDisplayed` (NOT `assertExists`, since off-screen lazy items still exist as semantic nodes in some configurations). Covers `LazyListState.layoutInfo.visibleItemsInfo` as the highest-signal probe, `mainClock.autoAdvance = false` for animated item placement, and the parameterized vertical/horizontal base-class pattern. Use when the developer asks "how do I scroll a LazyColumn in a test", "assertExists vs assertIsDisplayed", "scroll to a key", "test item placement animation", or sees a test pass when an item is off-screen.
license: Apache-2.0. See LICENSE for complete terms.
metadata:
  author: Jaewoong Eum (skydoves)
  keywords:
  - jetpack-compose
  - ui-testing
  - lazycolumn
  - lazyrow
  - lazylayout
  - performScrollToIndex
  - performScrollToKey
  - hasScrollAction
  - layoutInfo
  - visibleItemsInfo
  - assertIsDisplayed
---

# Testing Lazy Lists — Tag the Container, Scroll by Semantics, Probe `layoutInfo`

`LazyColumn` / `LazyRow` / `LazyVerticalGrid` only compose items that are or were near the viewport. That breaks the naive "find by text and assert" flow because off-screen items may not exist, may exist as detached semantic nodes, or may exist with wrong bounds. This skill encodes the patterns androidx itself uses — tag the container, scroll via the semantic action or via `testTag` + a swipe gesture, verify with `assertIsDisplayed`, and read `LazyListState.layoutInfo` for ground truth.

## When to use this skill

- The developer is writing a test for any `Lazy*` composable (`LazyColumn`, `LazyRow`, `LazyVerticalGrid`, `LazyHorizontalGrid`, `LazyVerticalStaggeredGrid`).
- A test asserts an item is "present" but the developer cannot tell whether it is on-screen.
- The developer wants to programmatically scroll to index 7, key `"key_10"`, or by an offset.
- A test asserts on a per-item index/offset and needs the canonical `state.layoutInfo` shape.
- The developer is testing `Modifier.animateItem()` or any item placement animation.
- A reviewer asks why `assertExists` is wrong for a lazy item.

## When NOT to use this skill

- The list under test is a non-lazy `Column`/`Row`/`FlowRow`. Use `../structuring-a-compose-test/SKILL.md` plus `../../assertions/asserting-node-state-and-text/SKILL.md`.
- The class skeleton itself is wrong; fix `../structuring-a-compose-test/SKILL.md` first.
- The scroll action is a custom `Modifier.scrollable` (not `LazyListState`-backed); use `../../actions/injecting-touch-gestures/SKILL.md`.
- The test is for animation timing; layer `../../synchronization/testing-animations-deterministically/SKILL.md`.

...

From skydoves's repository, Apache-2.0 licence.

Related skills

  • Checked

    JUnit and Mockito tests

    Writes and fixes Java tests with JUnit, AssertJ and Mockito that are deterministic and keep failures visible.

    by github 42k
    8/101 credit
  • Checked

    Test code review

    Reviews new or changed tests in pytest, Jest, Go and more, so weak tests are caught before merge.

    by amElnagdy 1.3k
    7/101 credit
  • Checked

    Go table driven tests

    Writes Go tests with table cases, fakes, fuzzing, benchmarks and golden files that stay fast and reliable.

    by ericrisco 691
    8/101 credit
  • Checked

    UX Click Budget Tests

    Writes Playwright tests that fail when a signup or checkout flow needs more clicks or fields than allowed.

    by Trystan-SA 2.1k
    7/101 credit
  • Checked

    Test Cases From Tickets

    Turns a ticket's acceptance criteria into traceable test cases with data, steps, expected results and proof.

    by rampstackco 1.1k
    7/101 credit
  • Checked

    VSTest to Testing Platform

    Switches your .NET tests and CI from VSTest to Microsoft.Testing.Platform with the right settings and commands.

    by dotnet 6.4k
    8/101 credit

Secure checkout

Credits

AUD

  1. 1Choose
  2. 2Pay on Square
  3. 3Credits added