asyncredux-testing-view-models

Test AsyncRedux view-models created by VmFactory in isolation.

238|39|Updated Aug 4, 2019
One-click install
npx skills add https://github.com/marcglasberg/async_redux --skill asyncredux-testing-view-models
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: asyncredux-testing-view-models
Source: https://github.com/marcglasberg/async_redux/tree/main/.claude/skills/asyncredux-testing-view-models
Command: npx skills add https://github.com/marcglasberg/async_redux --skill asyncredux-testing-view-models

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tests AsyncRedux view-models created by VmFactory in isolation. This guide helps verify that view-models accurately reflect state and expose correct callbacks without UI integration.

Core Features & Use Cases

  • Isolated validation of VmFactory-based view-models mapping state to properties.
  • Verification of callbacks that dispatch actions and trigger state changes.
  • Deterministic testing of view-model behavior using store wait utilities.

Quick Start

Create a test store, instantiate the view-model with Vm.createFrom() and a matching Factory, then assert that the view-model properties reflect the store state and that invoking callbacks dispatch actions.

Frequently Asked Questions about asyncredux-testing-view-models

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I unit test AsyncRedux view-models in isolation?

To unit test AsyncRedux view-models in isolation, create a test store, instantiate the view-model with Vm.createFrom() and a matching VmFactory, then assert properties and callback dispatches. This verifies state mappings without UI integration.

How do I verify that a VmFactory callback dispatches the correct action?

You can verify a VmFactory callback dispatches the correct action by invoking the callback within a test store and using deterministic store wait methods. This orchestrates callbacks and confirms the expected state changes occur.

Does this approach test Flutter widgets or just the view-model logic?

This approach tests just the view-model logic, not Flutter widgets. It validates property mappings and callback dispatches from the VmFactory in isolation, ensuring accurate state reflection without requiring UI integration.

What is the best way to test fromStore transformations in AsyncRedux?

The best way to test fromStore transformations in AsyncRedux is by setting up a test store and a VmFactory. This satisfies transformation constraints and allows deterministic verification of state changes produced by VM interactions.

Can I use store wait methods to deterministically test AsyncRedux view-models?

Yes, you can use store wait methods to deterministically test AsyncRedux view-models. These utilities allow you to wait for specific actions to dispatch and verify the resulting state changes triggered by VM interactions.