Skip to content

v1: component smoke test for App.tsx #22

Description

@gorlix

Context

Only the pure logic (computeLassoRect, pickInitialLanguage) is unit-tested. App.tsx (mount, tap handler, busy-guard reset, SDK orchestration) has no test. The sn-plugin-lib jest mock already exists (__mocks__/sn-plugin-lib.js).

Goal

A component/smoke test for App.tsx that mounts it with the mocked SDK and asserts the tap flow.

Approach

  • Render App with react-test-renderer (already a devDep) using the existing mock.
  • Simulate a press on the overlay; assert the mocked lassoElementssetLassoBoxStateclosePluginView sequence is called with the expected rect.
  • Assert the busy-guard is reset (a second simulated tap also fires the flow), guarding the regression fixed in fix(ui): reset busy guard so reopening the plugin works #14.

Acceptance criteria

  • Test mounts App without a device and passes in CI.
  • Asserts the lasso/close call order and the busy-reset behavior.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestv1Belongs to v1 scope

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions