Skip to content

Conversation

@noisysocks
Copy link
Contributor

@noisysocks noisysocks commented Jul 7, 2025

Asana Task/Github Issue: https://app.asana.com/1/137249556945/project/1209121419454298/task/1210670669716050

Description

Adds integration tests for some omnibar widget flows that currently work.

  • Basic Form Submission
    • Search form submission with Enter key
    • AI chat form submission with Enter key
    • AI chat button in search form submits chat message
    • Configuration fetching on page load
  • Mode Switching & State Management
    • Mode switching preserves query state (bidirectional)
    • AI tab disabled when AI is not enabled
    • Query preservation between search and chat modes
  • Keyboard Navigation
    • Arrow down navigation through suggestions (with wraparound)
    • Arrow up navigation through suggestions (with wraparound)
    • Arrow down + Enter opens selected suggestion
    • Tab key moves focus away from input
  • Mouse Interactions
    • Clicking on suggestion opens it
    • Mouse hover selects suggestion
    • Mouse out clears selection
  • Input Suggestion/Autocomplete
    • Title prefix matching: "pizza" + "pizza near me" → "pizza[ near me]"
    • URL prefix matching: "pizza" + "pizzahut.com" → "pizza[hut.com]"
    • No prefix match: "pizza" + "Italian Pizza History" → "[Italian Pizza History]”

There’s a few flows that don’t currently work. I’ll fix these and add tests for them in follow-up PRs:

  • Hint text (shown after the input value in blue).
  • Pressing arrow up / arrow down after pressing arrow left / arrow right should restore search to original search term.
  • Pressing ESC should keep suggestion text but close suggestions dropdown.
  • Clicking / focusing outside should close suggestions dropdown.

Testing Steps

Tests included.

Checklist

Please tick all that apply:

  • I have tested this change locally
  • I have tested this change locally in all supported browsers
  • This change will be visible to users
  • I have added automated tests that cover this change
  • I have ensured the change is gated by config
  • This change was covered by a ship review
  • This change was covered by a tech design
  • Any dependent config has been merged

@noisysocks noisysocks requested review from a team, mgurgel and shakyShane as code owners July 7, 2025 05:06
@noisysocks noisysocks added the tests Add or improve existing tests label Jul 7, 2025
@netlify
Copy link

netlify bot commented Jul 7, 2025

Deploy Preview for content-scope-scripts ready!

Name Link
🔨 Latest commit caa3511
🔍 Latest deploy log https://app.netlify.com/projects/content-scope-scripts/deploys/686b6235b77587000851eca3
😎 Deploy Preview https://deploy-preview-1798--content-scope-scripts.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link

github-actions bot commented Jul 7, 2025

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

@github-actions
Copy link

github-actions bot commented Jul 7, 2025

[Beta] Generated file diff

Time updated: Mon, 07 Jul 2025 06:00:07 GMT

@noisysocks noisysocks requested a review from shakyShane July 7, 2025 06:01
@noisysocks noisysocks merged commit 8e91deb into main Jul 7, 2025
18 checks passed
@noisysocks noisysocks deleted the randerson/omnibar-integration-tests branch July 7, 2025 06:10
mallexxx pushed a commit that referenced this pull request Jul 17, 2025
* Add basic integration tests for omnibar widget

* Add tests for omnibar suggestions

* Add input selection assertions for omnibar suggestions

* Replace regex role selectors with exact string matches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Add or improve existing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants