Skip to content

feat(web): anti-TWo-caps unit testing 🐵 #9834

@jahorton

Description

@jahorton

Unfortunately, I have to defer implementation of this due to triage, but I have the rough concept for a unit test for #9802 in mind.

Ideal TWo-caps prevention test:

Within gesture-recognizer's headless-testing section...

Setup

  • configuration's itemIdentifier function:
    • if state token 'default', output lowercase
    • if state token 'shift', output uppercase
    • first touch's coordinates => 'a' / 'A', depending on state token (as above)
    • second touch's coordinates => 'b' / 'B', depending on state token
  • the gesture-recognizer instance should start with the state token set as 'default'

Test

  • emulate LITERALLY simultaneous touches
    • two contact points; ensure both last around 40 ms and then release.
      • The coordinates should match those expected by itemIdentifier as mentioned above.
    • The InputSequenceSimulator unit test resource should already be well-positioned for simulating this in a unit test.
  • listen for sequences (recognizedGesture event)
    • first one:
      • verify expected output (lowercase) (either 'a' or 'b')
      • have handler for first sequence's 'stage' event set the recognizer's state token to 'shift'
    • second one:
      • verify expected output (uppercase) (either 'A' or 'B')

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions